public void SetMainUIActive(bool active) { if (m_currentMainUI == null) { return; } if (active) { m_currentMainUI.Show(); } else { m_currentMainUI.Hide(); } }
//UI加载完后的回调 void OnUILoaded(GameObject go) { string uiName = go.name.Replace("(Clone)", ""); object[] allParams = _loadingUIParams[uiName]; Component com = GameUtil.GetOrAddComponent(go.transform, uiName); Jyx2_UIBase uibase = com as Jyx2_UIBase; Transform parent = GetUIParent(uibase.Layer); go.transform.SetParent(parent); uibase.Init(); m_uiDic[uiName] = uibase; if (uibase.IsOnly)//如果这个层唯一存在 那么先关闭其他 { PopAllUI(uibase.Layer); } PushUI(uibase); uibase.Show(allParams); _loadingUIParams.Remove(uiName); }