transform.RotateAroundを使うとうまくいきました。
public class CameraRotator : MonoBehaviour {
public Transform Earth; ///回転対象
public float Speed = 0.5f;///回転速度
private Vector2 pivot;
void Update () {
if (Input.GetMouseButtonDown(0))
{
pivot = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
}
if (Input.GetMouseButton(0))
{
float deltaX = Input.mousePosition.x - pivot.x;
float deltaY = Input.mousePosition.y - pivot.y;
pivot = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
Camera.main.transform.RotateAround(Earth.position, (Camera.main.transform.up * deltaX + Camera.main.transform.right * (-deltaY)).normalized, Speed * Mathf.Sqrt(deltaX * deltaX + deltaY * deltaY));
}
}
}