Advertisement
Guest User

Untitled

a guest
May 26th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1.         if(Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.Alpha1))
  2.         {
  3.             TransitionToCam(GreenActivatorCam);
  4.         } // if input ends here
  5.         else if(Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.Alpha1))
  6.         { // go back to normal cam
  7.             MainCamera mainCam = KickStarter.mainCamera;
  8.             _Camera cam = mainCam.GetLastGameplayCamera();
  9.             TransitionToCam(cam);
  10.         } // else on keyboard inputs ends here
  11.     } // Update ends here
  12.     void TransitionToCam(_Camera whichCam)
  13.     {
  14.         MainCamera mainCam = KickStarter.mainCamera;
  15.         if (whichCam)
  16.         {
  17.             if (whichCam is GameCameraThirdPerson) // is this needed?
  18.             {
  19.                 GameCameraThirdPerson tpCam = (GameCameraThirdPerson) whichCam;
  20.                 tpCam.ResetRotation();
  21.             } // if which cam ends here
  22.             mainCam.SetGameCamera (whichCam, transitionTime, moveMethod, timeCurve, retainPreviousSpeed);
  23.         }// transition to cam ends here
  24.     } // transition to cam
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement