/// <summary> /// Switches the camera mode. /// </summary> /// <param name="state">State</param> public void SwitchCameraState(CameraState state) { if (_cameraState != null) { _cameraState.End(); } _cameraState = state; _cameraState.Init(); }
/// <summary> /// Switches the camera mode. /// </summary> /// <param name="state">State</param> public void SwitchCameraState(CameraState state) { if (ActiveState != null) { ActiveState.End(); } ActiveState = state; ActiveState.Init(); }
public void SetState(CameraState state) { if (currentState != null) { currentState.OnStateExit(); } currentState = state; if (currentState != null) { currentState.Init(); currentState.OnStateEnter(); } }
void OnEnable() { m_TargetCameraState.Init(transform, targetPosition, distance, minPitch, maxPitch, minDistance, maxDistance); m_InterpolatingCameraState.Init(transform, targetPosition, distance, minPitch, maxPitch, minDistance, maxDistance); }