Esempio n. 1
0
        public static void HidePanel(string panelName)
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.GameObjName = panelName;

            UIManager.Instance.HideUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();
        }
Esempio n. 2
0
        public static void HidePanel <T>() where T : UIPanel
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.PanelType = typeof(T);

            UIManager.Instance.HideUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();
        }
Esempio n. 3
0
        public static void ClosePanel(UIPanel panel)
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.Panel = panel;

            UIManager.Instance.CloseUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();
        }
Esempio n. 4
0
        public static void Back <T>()
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.PanelType = typeof(T);

            UIManager.Instance.CloseUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();

            Stack.Pop();
        }
Esempio n. 5
0
        public static UIPanel GetPanel(string panelName)
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.GameObjName = panelName;

            var retPanel = UIManager.Instance.GetUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();

            return(retPanel);
        }
Esempio n. 6
0
        public static T GetPanel <T>() where T : UIPanel
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.PanelType = typeof(T);

            var retPanel = UIManager.Instance.GetUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();

            return(retPanel as T);
        }
Esempio n. 7
0
        public static UIPanel OpenPanel(string panelName, UILevel level = UILevel.Common, string assetBundleName = null)
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.Level           = level;
            panelSearchKeys.AssetBundleName = assetBundleName;
            panelSearchKeys.GameObjName     = panelName;

            var retPanel = UIManager.Instance.OpenUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();

            return(retPanel as UIPanel);
        }
Esempio n. 8
0
        public static void Back(UIPanel currentPanel)
        {
            if (currentPanel.IsNotNull())
            {
                var panelSearchKeys = PanelSearchKeys.Allocate();

                panelSearchKeys.GameObjName = currentPanel.name;

                UIManager.Instance.CloseUI(panelSearchKeys);

                panelSearchKeys.Recycle2Cache();
            }

            Stack.Pop();
        }
Esempio n. 9
0
        public static void Back(string currentPanelName)
        {
            if (currentPanelName.IsNotNullAndEmpty())
            {
                var panelSearchKeys = PanelSearchKeys.Allocate();

                panelSearchKeys.GameObjName = currentPanelName;

                UIManager.Instance.CloseUI(panelSearchKeys);

                panelSearchKeys.Recycle2Cache();
            }

            Stack.Pop();
        }
Esempio n. 10
0
        public void Pop()
        {
            var previousPanelInfo = mUIStack.Pop();

            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.GameObjName     = previousPanelInfo.GameObjName;
            panelSearchKeys.Level           = previousPanelInfo.Level;
            panelSearchKeys.UIData          = previousPanelInfo.UIData;
            panelSearchKeys.AssetBundleName = previousPanelInfo.AssetBundleName;
            panelSearchKeys.PanelType       = previousPanelInfo.PanelType;

            UIManager.Instance.OpenUI(panelSearchKeys);

            panelSearchKeys.Recycle2Cache();
        }
Esempio n. 11
0
        public void Push(IPanel view)
        {
            if (view != null)
            {
                mUIStack.Push(view.Info);
                view.Close();

                var panelSearchKeys = PanelSearchKeys.Allocate();

                panelSearchKeys.GameObjName = view.Transform.name;

                UIManager.Instance.RemoveUI(panelSearchKeys);

                panelSearchKeys.Recycle2Cache();
            }
        }
Esempio n. 12
0
        public static T OpenPanel <T>(IUIData uiData, PanelOpenType panelOpenType = PanelOpenType.Single,
                                      string assetBundleName = null,
                                      string prefabName      = null) where T : UIPanel
        {
            var panelSearchKeys = PanelSearchKeys.Allocate();

            panelSearchKeys.OpenType        = panelOpenType;
            panelSearchKeys.Level           = UILevel.Common;
            panelSearchKeys.PanelType       = typeof(T);
            panelSearchKeys.AssetBundleName = assetBundleName;
            panelSearchKeys.GameObjName     = prefabName;
            panelSearchKeys.UIData          = uiData;

            T retPanel = UIManager.Instance.OpenUI(panelSearchKeys) as T;

            panelSearchKeys.Recycle2Cache();

            return(retPanel);
        }