Пример #1
0
    public void PushScreen(GUIScreen screen, bool isPopup)
    {
        if (!isPopup)
        {
            foreach (var curScreen in screenStack)
            {
                curScreen.Hide();
            }
        }
        screen.Show();
        screenStack.Push(screen);

        int i = 0;
    }
Пример #2
0
    public void ShowScreen(GUIScreen screen, bool hideAll = false)
    {
        if (hideAll)
        {
            foreach (var curScreen in screens)
            {
                if (curScreen.GetType() != screen.GetType())
                {
                    curScreen.Hide();
                }
            }
            screenStack.Clear();
        }

        screen.Show();
    }
Пример #3
0
    public void PopScreen()
    {
        if (screenStack.Count == 0)
        {
            return;
        }

        GUIScreen curScreen = screenStack.Pop();

        curScreen.Hide();

        if (screenStack.Count > 0)
        {
            GUIScreen newScreen = screenStack.Peek();
            newScreen.Show();
        }
    }
Пример #4
0
        public void PushScreen(GUIScreen screen, bool isPopup)
        {
            if (!isPopup)
            {
                foreach (var curScreen in screenStack)
                {
                    Debug.Log(curScreen.gameObject);
                    curScreen.Hide();
                }
            }

            screen.Show();
            screenStack.Push(screen);

            int i = 0;

            foreach (var curScreen in screenStack)
            {
                curScreen.OffsetZ = i++;
            }

            SortByLayer();
        }
Пример #5
0
 public void ShowScreen(ScreenType type)
 {
     HideCurrentScreen();
     currentScreen = GUIScreens.First(screen => screen.type == type);
     currentScreen.Show();
 }