/// <summary> /// 打开UI窗体 /// </summary> /// <param name="uiFormId"></param> /// <param name="userData"></param> internal void OpenUIForm(int uiFormId, object userData = null) { if (IsExists(uiFormId)) { return; } //读表 Sys_UIFormEntity entity = GameEntry.DataTable.DataTableManager.Sys_UIFormDBModel.Get(uiFormId); if (entity == null) { Debug.LogError(uiFormId + " 当前表不存在"); return; } #if DISABLE_ASSETBUNDLE && UNITY_EDITOR UIFormBase formBase = GameEntry.UI.Dequeue(uiFormId); if (formBase == null) { string assetString = string.Empty; switch (GameEntry.Localization.CurrLanguage) { case GameLanguage.Chinese: assetString = entity.AssetPath_Chinese; ; break; case GameLanguage.English: assetString = entity.AssetPath_English; ; break; default: break; } string path = string.Format("Assets/Download/UI/UIPrefab/{0}.prefab", assetString); //加载镜像 Object obj = UnityEditor.AssetDatabase.LoadAssetAtPath <GameObject>(path); GameObject uiObj = Object.Instantiate(obj) as GameObject; uiObj.SetParent(GameEntry.UI.GetUIGroup(entity.UIGroupId).Group); uiObj.transform.localPosition = Vector3.zero; uiObj.transform.localScale = Vector3.one; formBase = uiObj.GetComponent <UIFormBase>(); formBase.Init(uiFormId, entity.UIGroupId, entity.DisableUILayer == 1, entity.IsLock == 1, userData); } else { formBase.gameObject.SetActive(true); formBase.Open(userData); } m_OpenUIList.AddLast(formBase); #endif }
/// <summary> /// ÉèÖò㼶ÅÅÐò /// </summary> /// <param name="formBase"></param> /// <param name="isAdd"></param> internal void SetSortingOrder(UIFormBase formBase, bool isAdd) { if (isAdd) { m_UILayerDic[formBase.GroupId] += 10; } else { m_UILayerDic[formBase.GroupId] -= 10; } formBase.CurrCanvas.sortingOrder = m_UILayerDic[formBase.GroupId]; }
/// <summary> /// ui回池 /// </summary> internal void Enqueue(UIFormBase uiformBase) { uiformBase.gameObject.SetActive(false); m_UIFormList.AddLast(uiformBase); }
/// <summary> /// ui回池 /// </summary> public void Enqueue(UIFormBase uiformBase) { m_UIPool.Enqueue(uiformBase); }
/// <summary> /// 设置层级排序 /// </summary> /// <param name="formBase"></param> /// <param name="isAdd"></param> public void SetSortingOrder(UIFormBase formBase, bool isAdd) { m_UILayer.SetSortingOrder(formBase, isAdd); }
/// <summary> /// 关闭UI窗体 /// </summary> /// <param name="formBase"></param> public void CloseUIForm(UIFormBase formBase) { m_UIManager.CloseUIForm(formBase); }
internal void CloseUIForm(UIFormBase formBase) { m_OpenUIList.Remove(formBase); formBase.ToClose(); }