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();
            SortByLayer();
        }
        public void PopScreen()
        {
            if (screenStack.Count == 0)
            {
                return;
            }

            GUIScreen curScreen = screenStack.Pop();

            curScreen.Hide();

            if (screenStack.Count > 0)
            {
                GUIScreen newScreen = screenStack.Peek();
                newScreen.Show();
                //newScreen.transform.SetAsLastSibling();
            }

            SortByLayer();
        }
        public void PushScreen(GUIScreen screen, bool isPopup)
        {
            if (!isPopup)
            {
                foreach (var curScreen in screenStack)
                {
                    Debug.Log(curScreen.gameObject);
                    curScreen.Hide();
                }
            }

            //screen.transform.SetAsLastSibling();
            screen.Show();
            screenStack.Push(screen);

            int i = 0;

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

            SortByLayer();
        }