Advertisement
EmmyDev

Terminal Initiate

Dec 29th, 2022 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | Source Code | 0 0
  1. public void InitInteraction(GameObject user, Camera userCam, string inputMethod)
  2.     {
  3.         if(inUse && inputMethod == "Esc")
  4.         {
  5.             EndInteraction(user,userCam);
  6.         }
  7.         else if(inUse == false && inputMethod == "E")
  8.         {
  9.             StartInteraction(user,userCam);
  10.         }
  11.  
  12.     }
  13.  
  14.  
  15.  
  16.     public void StartInteraction(GameObject user, Camera userCam)
  17.     {
  18.         inUse = true;
  19.         user.GetComponent<CharacterController>().enabled = false;
  20.         user.GetComponent<FpsController>().enabled = false;
  21.  
  22.         user.transform.position = tempPos.position;
  23.         user.transform.rotation = tempPos.rotation;
  24.         userCam.transform.rotation = tempPos.rotation;
  25.  
  26.         ConsoleFocus();
  27.  
  28.     }
  29.  
  30.    
  31.     public void EndInteraction(GameObject user, Camera userCam)
  32.     {
  33.         inUse = false;
  34.         user.GetComponent<CharacterController>().enabled = true;
  35.         user.GetComponent<FpsController>().enabled = true;
  36.  
  37.         ConsoleUnfocus();
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement