public void Pause() { if (!paused) { Time.timeScale = 0; paused = true; pauseScreen.SetActive(true); pauseScreen.GetComponent <PauseScreen> ().TurnOffAllPanels(); foreach (PlayerManager PM in playerManagers) { if (PM.playerInstance != null) { PM.EnableMovement(false); } } homeScreenMovement.enabled = false; } else { Time.timeScale = 1; paused = false; pauseScreen.SetActive(false); foreach (PlayerManager PM in playerManagers) { if (PM.playerInstance != null) { PM.EnableMovement(true); } } homeScreenMovement.enabled = true; } }