Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var GUIon:boolean;
- function Start()
- {
- GUIon = false;
- Screen.lockCursor = true;
- }
- function Update()
- {
- if(Input.GetButtonDown("Menu"))GUIon=!GUIon;
- }
- function OnGUI()
- {
- if(GUIon)
- {
- Screen.lockCursor = false;
- GUI.Box (Rect (0,0,500,300), "FOV");
- if (GUI.Button (Rect (20,20,80,80), "FOV = 70"))
- {
- Camera.main.fieldOfView = 70;
- }
- else if (GUI.Button (Rect (100,20,80,80), "FOV = 80"))
- {
- Camera.main.fieldOfView = 80;
- }
- else if (GUI.Button (Rect (180,20,80,80), "FOV = 90"))
- {
- Camera.main.fieldOfView = 90;
- }
- }
- else if(!GUIon && !Screen.lockCursor)
- {
- Screen.lockCursor = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement