Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var paused : boolean = false;
- var myCheck : boolean = false;
- function Start(){
- paused=false;
- }
- function Update () {
- if(Input.GetButtonDown( "Pause" ) ) {
- if(!paused) {
- Time.timeScale = 0;
- paused = true;
- Screen.lockCursor = false;
- var firstPersonControllerCamera = gameObject.Find("First Person Controller").GetComponent(MouseLook);
- var mainCamera = gameObject.Find("Main Camera").GetComponent(MouseLook);
- firstPersonControllerCamera.enabled = false;
- mainCamera.enabled = false;
- }else{
- Time.timeScale = 1;
- paused = false;
- Screen.lockCursor = true;
- firstPersonControllerCamera = gameObject.Find("First Person Controller").GetComponent(MouseLook);
- mainCamera = gameObject.Find("Main Camera").GetComponent(MouseLook);
- firstPersonControllerCamera.enabled = true;
- mainCamera.enabled = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement