I've tried combining two RotateArounds and then reading mouse offsets, but it shakes violently when it reaches the top. I attempted to lock it at 90 degrees, but it still didn't work. I haven't found a good way to achieve it, as regular rotation also has gimbal lock issues.
I hope to achieve the orbit rotation similar to Alt + left-click in the Unity editor, and also to lock at 90 degrees at the top, rather than continuing the orbit rotation after reaching the top, which would cause the screen to be inverted.
it part of script, but this will achive it;
var delta = mPlayerInput.CameraCC.MouseDelta.ReadValue<Vector2>();
if (delta == Vector2.zero) return;
float x = mCamera.transform.eulerAngles.y;
float y = mCamera.transform.eulerAngles.x;
var distance = Vector3.Distance(Target.position, mCamera.transform.position);
if (x > 180) x -= 360;
if (y > 180) y -= 360;
x += delta.x * xSpeed * 0.02f;
y -= delta.y * ySpeed * 0.02f;
y = ClampAngle(y, yMinLimit, yMaxLimit);
Quaternion rotation = Quaternion.Euler(y, x, 0);
Vector3 position = rotation * new Vector3(0.0f, 0.0f, -distance) + Target.position;
mCamera.transform.SetPositionAndRotation(position, rotation);