// Use this for initialization void Awake() { paused = false; cursorLock = GetComponent <CursorLock> (); cursorLock.Lock(); GameControllerRunnable[] initScripts = GetComponents <GameControllerRunnable> (); foreach (GameControllerRunnable gcr in initScripts) { gcr.Init(); } }
void OnPause() { paused = !paused; if (paused) { Time.timeScale = 0f; cursorLock.Unlock(); } else { Time.timeScale = 1f; cursorLock.Lock(); } }