Ejemplo n.º 1
0
        /// <summary>
        /// Switch to another UI_Screen. Won't switch if the current scene is the same as the one to switch to.
        /// </summary>
        /// <param name="screen"></param>
        public void SwitchScreen(UI_Screen screen)
        {
            if (screen == _currScreen)
            {
                return;
            }

            switchScreen(screen);
        }
Ejemplo n.º 2
0
        private void switchScreen(UI_Screen screen)
        {
            if (screen)
            {
                if (_currScreen)
                {
                    _currScreen.CloseScreen();
                    _prevScreen = _currScreen;
                }

                _currScreen = screen;
                _currScreen.gameObject.SetActive(true);
                _currScreen.StartScreen();

                if (OnSwitchedScreen != null)
                {
                    OnSwitchedScreen.Invoke();
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Switch to UI_Screen regardless of if this is the current scene
 /// </summary>
 /// <param name="screen"></param>
 public void ForceSwitchScreen(UI_Screen screen)
 {
     switchScreen(screen);
 }