Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.Alpha1))
- {
- TransitionToCam(GreenActivatorCam);
- } // if input ends here
- else if(Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.Alpha1))
- { // go back to normal cam
- MainCamera mainCam = KickStarter.mainCamera;
- _Camera cam = mainCam.GetLastGameplayCamera();
- TransitionToCam(cam);
- } // else on keyboard inputs ends here
- } // Update ends here
- void TransitionToCam(_Camera whichCam)
- {
- MainCamera mainCam = KickStarter.mainCamera;
- if (whichCam)
- {
- if (whichCam is GameCameraThirdPerson) // is this needed?
- {
- GameCameraThirdPerson tpCam = (GameCameraThirdPerson) whichCam;
- tpCam.ResetRotation();
- } // if which cam ends here
- mainCam.SetGameCamera (whichCam, transitionTime, moveMethod, timeCurve, retainPreviousSpeed);
- }// transition to cam ends here
- } // transition to cam
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement