Ejemplo n.º 1
0
        void ChangeGameState(EGamestate type)
        {
            fsm.State.Deactivate();
            fsm.ChangeState(type);
            fsm.State.Activate();

            Bootstrap.currentState = fsm.State;
        }
Ejemplo n.º 2
0
 public GameState(EGamestate type, bool isRestarting, EGamestate[] additionalScreens, params MonoBehaviour[] systems)
 {
     Systems = systems.Select(x => x as IGameSystem).ToArray();
     StatesIncludingSubstates = new GameState[] { this };
     AdditionalScreens        = additionalScreens;
     this.isRestarting        = isRestarting;
     Type = type;
     Setup();
 }
Ejemplo n.º 3
0
        public static void OpenScreen(EGamestate type)
        {
            foreach (var screen in stateScreens.Values)
            {
                screen.Close();
            }

            if (stateScreens.ContainsKey(type))
            {
                stateScreens[type].Open();
                background.gameObject.SetActive(stateScreens[type].UseBackground);
                ChangeBackground(stateScreens[type].BackgroundSprite, stateScreens[type].BackgroundColor);
            }
        }
Ejemplo n.º 4
0
 public static void ChangeGameState(EGamestate type)
 {
     lastState = GetCurrentGamestate();
     OnStateChangedEvent?.Invoke(type);
 }
Ejemplo n.º 5
0
 public static UIScreen GetUIScreen(EGamestate type)
 {
     return(stateScreens[type]);
 }
Ejemplo n.º 6
0
 public static void CloseScreen(EGamestate type)
 {
     stateScreens[type].Close();
 }
Ejemplo n.º 7
0
 public static void OpenScreenAdditionaly(EGamestate type)
 {
     stateScreens[type].Open();
 }