SHARE
TWEET

Untitled

a guest Aug 3rd, 2012 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var GUIon:boolean;
  2.  
  3. function Start()
  4. {
  5.         GUIon = false;
  6.         Screen.lockCursor = true;
  7. }
  8.  
  9. function Update()
  10. {
  11.         if(Input.GetButtonDown("Menu"))GUIon=!GUIon;
  12. }
  13. function OnGUI()
  14. {
  15.         if(GUIon)
  16.         {
  17.                 Screen.lockCursor = false;
  18.                 GUI.Box (Rect (0,0,500,300), "FOV");
  19.  
  20.                 if (GUI.Button (Rect (20,20,80,80), "FOV = 70"))
  21.                 {
  22.                         Camera.main.fieldOfView = 70;
  23.                 }
  24.                 else if (GUI.Button (Rect (100,20,80,80), "FOV = 80"))
  25.                 {
  26.                         Camera.main.fieldOfView = 80;
  27.                 }
  28.                 else if (GUI.Button (Rect (180,20,80,80), "FOV = 90"))
  29.                 {
  30.                         Camera.main.fieldOfView = 90;
  31.                 }
  32.         }
  33.         else if(!GUIon && !Screen.lockCursor)
  34.         {
  35.                 Screen.lockCursor = true;
  36.         }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top