Example #1
0
        public void PrepareScreen(Screens screen)
        {
            UIContainer.Instance.HideAll();
            UIContainer.Instance.UnParentAll();

            Debug.Log("PrepareScreen");

            for (int i = 0; i < screenElements.Count; i++)
            {
                if (screen.Equals(screenElements[i].Screen))
                {
                    Debug.Log("ScreenFound");
                    Debug.Log("Number of PanelObj = " + screenElements[i].Panels.Count);
                    for (int j = 0; j < screenElements[i].Panels.Count; j++)
                    {
                        screenElements[i].Panels[j].Panel.gameObject.SetActive(false);
                        for (int k = 0; k < screenElements[i].Panels[j].UIElements.Count; k++)
                        {
                            screenElements[i].Panels[j].UIElements[k].UIElement.parent = screenElements[i].Panels[j].Panel;
                            SetRectTransformData(screenElements[i].Panels[j].UIElements[k]);
                            screenElements[i].Panels[j].UIElements[k].UIElement.gameObject.SetActive(true);
                        }
                    }
                }
            }

            ShowScreen(screen);
        }
Example #2
0
        private void ShowScreen(Screens screen)
        {
            for (int i = 0; i < screenElements.Count; i++)
            {
                if (screen.Equals(screenElements[i].Screen))
                {
                    for (int j = 0; j < screenElements[i].Panels.Count; j++)
                    {
                        screenElements[i].Panels[j].Panel.gameObject.SetActive(true);
                    }
                }
            }

            currentScreen = screen;
        }