Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement