public override void Init(BehaviourSettings _cameraSettings, Camera _camera, CM_CameraBehaviour.FollowVectorType _fAxis) { base.Init(_cameraSettings, _camera, _fAxis); debugColor = Color.green; OnUpdateBehaviour += FollowTarget; OnUpdateBehaviour += LookAtTarget; }
public virtual void Init(BehaviourSettings _cameraSettings, Camera _camera, CM_CameraBehaviour.FollowVectorType _fAxis) { if (!_camera) { return; } camera = _camera; cameraSettings = _cameraSettings; cameraTransform = _camera.transform; fAxis = _fAxis; }
void InitBehaviourComponent() { CM_CameraBehaviour.FollowVectorType _fAxis = CM_CameraBehaviour.FollowVectorType.up; switch (camType) { case CM_CameraType.FPS: cameraBehaviour = gameObject.AddComponent <CM_CameraFPSBehaviour>(); break; } if (cameraBehaviour) { cameraBehaviour.Init(cameraSettings, camera, _fAxis); OnregisterCamera?.Invoke(); OnregisterCamera = null; } }
void InitBehaviour() { CM_CameraBehaviour.FollowVectorType _fAxis = CM_CameraBehaviour.FollowVectorType.Up; switch (type) { case CM_CameraType.RTS: break; case CM_CameraType.TPS: cameraBehaviour = gameObject.AddComponent <CM_CameraTpsBehaviour>(); _fAxis = CM_CameraBehaviour.FollowVectorType.Backward; break; case CM_CameraType.FPS: break; case CM_CameraType.ROTATE_AROUND: cameraBehaviour = gameObject.AddComponent <CM_CameraRotateAroundBehaviour>(); _fAxis = CM_CameraBehaviour.FollowVectorType.Backward; break; case CM_CameraType.OSCILLATION: cameraBehaviour = gameObject.AddComponent <CM_CameraOscillationBehaviour>(); _fAxis = CM_CameraBehaviour.FollowVectorType.Backward; break; case CM_CameraType.SHAKE: cameraBehaviour = gameObject.AddComponent <CM_CameraShakeBehaviour>(); _fAxis = CM_CameraBehaviour.FollowVectorType.Backward; break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } if (cameraBehaviour) { cameraBehaviour.Init(camSettings, camera, _fAxis); } }