예제 #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();
 }