Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class PauseController : MonoBehaviour
- {
- void Update()
- {
- if (Input.GetKeyDown("Escape"))
- {
- GameState currentGameState = GameStateManager.Instance.CurrentGameState;
- GameState newGameState = currentGameState == GameState.Gameplay
- ? GameState.Paused
- : GameState.Gameplay;
- GameStateManager.Instance.SetState(newGameState);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment