Struct OrbitalCameraState
- Namespace
- Goehler.OrbitalCam
- Assembly
- Goehler.OrbitalCam.Runtime.dll
Snapshot of an OrbitalCameraSystem's state: position, Y-rotation, tilt, and zoom. Capture with GetState() and restore with SetState(OrbitalCameraState). Works with UnityEngine.JsonUtility for save games or persistent camera state.
[Serializable]
public struct OrbitalCameraState
Remarks
Follow target is not saved with the snapshot. After loading a state, call SetFollowTarget(Transform) with whatever target your game tracks if you want to restore the follow as well.
Constructors
OrbitalCameraState(Vector3, float, float, float)
public OrbitalCameraState(Vector3 position, float rotationY, float tilt, float zoom)
Parameters
Fields
position
World-space position of the CameraOrigin.
public Vector3 position
Field Value
- Vector3
rotationY
Horizontal rotation in degrees (Y-axis euler).
public float rotationY
Field Value
tilt
Vertical tilt in degrees. Clamped to MinTiltAngle..MaxTiltAngle on SetState(OrbitalCameraState).
public float tilt
Field Value
zoom
Camera distance from the target in world units. Clamped to MinZoomDistance..MaxZoomDistance on SetState(OrbitalCameraState).
public float zoom
Field Value
Methods
ToString()
public override string ToString()