30 lines
651 B
C#
30 lines
651 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Pause : MonoBehaviour {
|
|
|
|
bool Paused = false;
|
|
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
{
|
|
Paused = !Paused;
|
|
}
|
|
|
|
if (Paused)
|
|
{
|
|
Cursor.lockState = CursorLockMode.None;
|
|
Cursor.visible = true;
|
|
GetComponent<UniStormMouseLook>().enabled = false;
|
|
}
|
|
else
|
|
{
|
|
Cursor.lockState = CursorLockMode.Locked;
|
|
Cursor.visible = false;
|
|
GetComponent<UniStormMouseLook>().enabled = true;
|
|
}
|
|
}
|
|
}
|