public static void CloseUIByID(int tableID) { if (null == m_instance) { LogModule.ErrorLog("game manager is not init"); return; } Tab_UIPath curTabPath = TableManager.GetUIPathByID(tableID, 0); if (null == curTabPath) { LogModule.ErrorLog("cur ui is not set in table" + tableID); return; } if (!UIPathData.m_DicUIInfo.ContainsKey(curTabPath.Path)) { LogModule.ErrorLog("cur ui is not set in table " + curTabPath.Path); return; } UIPathData curPathData = UIPathData.m_DicUIInfo[curTabPath.Path]; CloseUI(curPathData); }
void OpenUI(Tab_UIPath uiPath) { if (UIPathData.m_DicUIInfo.ContainsKey(uiPath.Path)) { UIPathData curData = UIPathData.m_DicUIInfo[uiPath.Path]; // 科技院单独处理 if (uiPath.Path == "Prefab/UI/Restaurant") { RestaurantController.OpenWindow(true); } else { UIManager.ShowUI(curData, (bSuccess, param) => { if (!string.IsNullOrEmpty(uiPath.Param)) { switch (uiPath.Path) { case "Prefab/UI/ActivityController": ActivityController.Instance().m_HuoDongControl.ChangeTab(uiPath.Param); break; case "Prefab/UI/PartnerFrameRoot": PartnerFrameLogic.Instance().m_TabController.ChangeTab(uiPath.Param); break; } } }); } } }
// 读表展示UI, public static bool ShowUIByID(int tableID, OnOpenUIDelegate delOpenUI = null, object param = null) { if (null == m_instance) { LogModule.ErrorLog("game manager is not init"); return(false); } Tab_UIPath curTabPath = TableManager.GetUIPathByID(tableID, 0); if (null == curTabPath) { LogModule.ErrorLog("cur ui is not set in table" + tableID); return(false); } if (!UIPathData.m_DicUIInfo.ContainsKey(curTabPath.Path)) { LogModule.ErrorLog("cur ui is not set in table" + curTabPath.Path); return(false); } UIPathData curData = UIPathData.m_DicUIInfo[curTabPath.Path]; return(UIManager.ShowUI(curData, delOpenUI, param)); }
void GoToUI(GameObject go) { NewPlayerGuidLogic.CloseWindow(); if (mGoToUIId != -1) { Tab_UIPath uiPath = TableManager.GetUIPathByID(mGoToUIId, 0); // 按等级解锁 if (uiPath.Lv != -1) { if (Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level >= uiPath.Lv) { OpenUI(uiPath); } else if (uiPath.Tips != -1) { MessageBoxLogic.OpenOKBox(StrDictionary.GetClientDictionaryString("#{" + uiPath.Tips.ToString() + "}", uiPath.Lv)); } return; } // 按标记解锁 if (uiPath.USERCOMMONFLAG != -1) { if (GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag(uiPath.USERCOMMONFLAG)) { OpenUI(uiPath); } else if (uiPath.Tips != -1) { MessageBoxLogic.OpenOKBox(uiPath.Tips); } return; } // 无限制 OpenUI(uiPath); } }