Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Ppauser : MonoBehaviour {
- public bool paused = false;
- void Update()
- {
- if (Input.GetKeyDown(KeyCode.Escape) && paused == false)
- {
- paused = true;
- Cursor.visible = true;
- Cursor.lockState = CursorLockMode.None;
- }
- else if (Input.GetKeyDown(KeyCode.Escape) && paused == true)
- {
- paused = false;
- Cursor.visible = false;
- Cursor.lockState = CursorLockMode.Locked;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement