示例#1
0
 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;
     }
 }
示例#2
0
    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);
        }
    }