Example #1
0
        public void Initialize()
        {
            //TODO(dwong): load from save state.

            StateList            = Resources.Load <GameStateList>("Game State Data/Game State List");
            currentGameStateData = StateList[0];
        }
 void Update()
 {
     if (gameStateData == gameStateManager.CurrentGameStateData)
     {
         return;
     }
     gameStateData = gameStateManager.CurrentGameStateData;
     UpdateDisplay();
 }
Example #3
0
        public void SetGameState(GameStateData state, bool persist = false)
        {
            if (state == null)
            {
                Debug.LogError("Null game state passed in.");
                return;
            }

            currentGameStateData = state;

            OnAllReset?.Invoke();
            if (persist)
            {
                return;
            }
            OnNonpersistReset?.Invoke();
        }
 void Awake()
 {
     gameStateData = gameStateManager.CurrentGameStateData;
     UpdateDisplay();
 }