public void SwitchCameraMode(ECameraModeType type) { if (mCamMode != null) { mCamMode.OnSwitchMode(); } switch (type) { case ECameraModeType.DefaultCamera: { mCamMode = new CameraMode(); } break; case ECameraModeType.ThirdPersonCamera: { mCamMode = new ThirdPersonCameraMode(); } break; case ECameraModeType.FreedomCamera: { mCamMode = new FreedomCameraMode(); } break; } if (mCamMode != null) { mCamMode.transform = mCamTrans; mCamMode.Init(); } }