Ejemplo n.º 1
0
        public void ShowScreen <T>(bool hideAll = false) where T : GUIScreen
        {
            GUIScreen foundScreen = FoundScreen <T>();

            if (foundScreen != null)
            {
                ShowScreen(foundScreen, hideAll);
            }
            else
            {
                Debug.LogWarning("Screen " + typeof(T) + " not found!");
            }
        }
Ejemplo n.º 2
0
        public void HideScreen <T>() where T : GUIScreen
        {
            GUIScreen foundScreen = FoundScreen <T>();

            if (foundScreen != null)
            {
                foundScreen.Hide();
                SortByLayer();
            }
            else
            {
                Debug.LogWarning("Screen " + typeof(T) + " not found!");
            }
        }
Ejemplo n.º 3
0
        public void ShowScreen(GUIScreen screen, bool hideAll = false)
        {
            if (hideAll)
            {
                foreach (var curScreen in screens)
                {
                    if (curScreen.GetType() != screen.GetType() && curScreen.IsShowed)
                    {
                        curScreen.Hide();
                    }
                }
            }

            screen.Show();
            SortByLayer();
        }
Ejemplo n.º 4
0
        private void Start()
        {
            foreach (var curPrefab in screenPrefabs)
            {
                GameObject curScreen = Instantiate(curPrefab);
                curScreen.transform.SetParent(screensRoot != null ? screensRoot.transform : gameObject.transform, false);

                GUIScreen guiScreen = curScreen.GetComponent <GUIScreen>();
                screens.Add(guiScreen);
            }

            foreach (var curScreen in screens)
            {
                curScreen.gameObject.SetActive(false);
            }

            foreach (var curScreen in currentScreens)
            {
                screens.Add(curScreen);
                curScreen.Show();
            }
        }
Ejemplo n.º 5
0
 public void HideScreen(GUIScreen screen)
 {
     screen.Hide();
     SortByLayer();
 }