/// <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); }
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(); }
public static BasePanel GetPanelBusiness(UIPanelName name) { switch (name) { case UIPanelName.GameStartPanel: return(new GameStartPanel()); default: Debug.LogError("不存在此面板" + name.ToString()); return(null); } }