Ejemplo n.º 1
0
        /// <summary>
        /// 获取面板的游戏物体
        /// </summary>
        private GameObject GetPanelGO(UIPanelName panelName, string path)
        {
            GameObject instPanel = panelGODict.TryGet(panelName);


            if (instPanel == null)
            {
                GameObject res = ResMgr.Instance.GetRes <GameObject>(uiPrefabPath + panelName.ToString());
                instPanel      = GameObject.Instantiate(res) as GameObject;
                instPanel.name = panelName.ToString();
                panelGODict.Add(panelName, instPanel);
            }

            if (!currentScenePanelDict.ContainsKey(panelName))
            {
                currentScenePanelDict.Add(panelName, instPanel);
            }
            return(instPanel);
        }
Ejemplo n.º 2
0
        public static UIPanelInfo GetPanelInfo(UIPanelName name)
        {
            var index = (int)name;

            if (index < panelInfoArr.Length)
            {
                return(panelInfoArr[(int)name]);
            }
            Debug.LogError("没有该面板的PanelInfo:" + name.ToString());
            throw new System.Exception();
        }
Ejemplo n.º 3
0
        public static BasePanel GetPanelBusiness(UIPanelName name)
        {
            switch (name)
            {
            case UIPanelName.GameStartPanel: return(new GameStartPanel());


            default:
                Debug.LogError("不存在此面板" + name.ToString());
                return(null);
            }
        }