Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1.  
  2. using System;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5.  
  6. [CreateAssetMenu(fileName = "GameState", menuName = "Super Critical/Game State")]
  7. public class GameState : ScriptableObject
  8. {
  9.     [ShowInInspector, ReadOnly]
  10.     bool m_paused;
  11.  
  12.     public static event Action OnPause;
  13.  
  14.     public bool Paused
  15.     {
  16.         get { return m_paused; }
  17.         set
  18.         {
  19.             m_paused = value;
  20.             OnPause.Invoke();
  21.         }
  22.     }
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. using Pixelplacement;
  32. using UnityEngine;
  33. using Sirenix.OdinInspector;
  34.  
  35.  
  36. public class GameManager : Singleton<GameManager>
  37. {
  38.     [Required] public GameState GameState;
  39.  
  40.     void Start()
  41.     {
  42.         GameState.Paused = false;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement