internal void CloseAllClidren(bool circle = true, float time = 0, params object[] paramValues) { if (circle) { for (int i = childrenNodeID.Count - 1; i >= 0; i--) { int id = childrenNodeID[i]; IBaseUIForm uiForm = childrenNode[id].Node; CircleClose(uiForm, time, paramValues); if (uiForm.UIStage != UIState.Hide) { uiForm.CloseUI(time, paramValues); } } } else { for (int i = childrenNodeID.Count - 1; i >= 0; i--) { int id = childrenNodeID[i]; IBaseUIForm uiForm = childrenNode[id].Node; if (uiForm.UIStage != UIState.Hide) { uiForm.CloseUI(time, paramValues); } } } }
internal void AddCloseEndCommand(IBaseUIForm optionUI, params object[] paramValues) { UICommand openUIDown = _UICommandPool.Spawn(); openUIDown.InitDate(UICommandType.CloseEndUI, optionUI, 0, paramValues); _Invoker.AddCommand(openUIDown); }
/// <summary> /// 添加子节点 /// </summary> /// <param UIName="child"></param> internal void AddChildNode(IBaseUIForm child) { if (!childrenNodeID.Contains(child.ID)) { //todo 对象池获取 UIFormNode node = new UIFormNode(); node.Init(child); childrenNode.Add(node.ID, node); childrenNodeID.Add(node.ID); } else { if (!childrenNode.ContainsKey(child.ID)) { UIFormNode node = new UIFormNode(); node.Init(child); childrenNode.Add(node.ID, node); Debug.LogError("添加子节点有误"); } else { childrenNode[child.ID].Init(child); } } }
public IBaseUIForm OpenUI(IBaseUIForm uiForm, float time = 0, params object[] paramVaules) { if (uiForm == null) { Debug.LogError("要打开的UI窗体为Null"); return(null); } //设置默认时间 if (LtFramework.Util.Math.MathUtil.FloatEqual(time, 0f)) { time = uiForm.OpenUITime; } //添加依赖节点 if (uiForm != this) { UIFormDepend.AddChildNode(uiForm); uiForm.UIFormDepend.SetParent(this); } //添加打开命令 UIMonoManager.Instance.AddOpenCommand(uiForm, time, paramVaules); UIMonoManager.Instance.AddOpenUIEndCommand(uiForm, paramVaules); return(uiForm); }
internal void AddShowUICommand(IBaseUIForm optionUI, float time, params object[] paramValues) { UICommand showUI = _UICommandPool.Spawn(); showUI.InitDate(UICommandType.ShowUI, optionUI, time, paramValues); _Invoker.AddCommandLastSecond(showUI); }
public void InitDate(UICommandType type, IBaseUIForm uiForm, float timer = 0, params object[] paramValues) { commandData.Init(type, uiForm, timer, paramValues); this.timer.SetTimer(timer); isExec = false; }
/// <summary> /// 添加控制UI /// </summary> /// <param UIName="uiFrom"></param> internal void AddCtrlUIForm(IBaseUIForm uiFrom) { if (!_CanCtrlUIForm.Contains(uiFrom)) { lock (_Mutex) { _CanCtrlUIForm.Add(uiFrom); } } }
internal void AddThawCommand(IBaseUIForm optionUI, float time, params object[] paramValues) { optionUI.DisableSelectCount--; UICommand openUIDown = _UICommandPool.Spawn(); openUIDown.InitDate(UICommandType.ThawUI, optionUI, time, paramValues); _Invoker.AddCommand(openUIDown); //Debug.LogError("解冻 :" + optionUI.name); }
internal void RemoveCloseingUIForm(IBaseUIForm uiForm) { if (_ClosingUIFormList.Contains(uiForm)) { _ClosingUIFormList.Remove(uiForm); } else { Debug.LogError("当前窗口已经关闭"); } }
public void Reset() { Timer = 0; ID = 0; _ParamValues.Clear(); OptionUI = null; ExecuteStart = null; ExecuteUpdate = null; ExecuteEnd = null; CommandType = UICommandType.Null; }
internal void RemoveOpeningUIForm(IBaseUIForm uiForm) { if (_OpeningUIFormList.Contains(uiForm)) { _OpeningUIFormList.Remove(uiForm); } else { Debug.LogError("当前窗口已经关闭 + " + uiForm.name); } }
internal void AddThawingUIForm(IBaseUIForm uiForm) { if (!_ThawingUIFormList.Contains(uiForm)) { _ThawingUIFormList.Add(uiForm); } else { Debug.LogError("当前窗口正在冻结"); } }
/// <summary> /// 递归解冻子节点 /// </summary> /// <param UIName="uiForm"></param> private void CircleThaw(IBaseUIForm uiForm, float time, params object[] paramValues) { List <int> clildrenID = uiForm.UIFormDepend.childrenNodeID; for (int i = clildrenID.Count - 1; i >= 0; i--) { IBaseUIForm ui = uiForm.UIFormDepend.childrenNode[childrenNodeID[i]].Node; CircleThaw(ui, time, paramValues); ui.ThawUI(time, paramValues); } }
public TBaseUI MyCloseUI <TBaseUI>(CloseUIType closeUIType = CloseUIType.Destroy, float time = 0, params object[] paramValues) where TBaseUI : IBaseUIForm { IBaseUIForm uiForm = CloseUI <TBaseUI>(time, paramValues); if (closeUIType == CloseUIType.Destroy) { UIMonoManager.Instance.AddDestroyCommand(uiForm); } return(null); }
internal void AddCloseingUIForm(IBaseUIForm uiForm) { if (!_ClosingUIFormList.Contains(uiForm)) { _ClosingUIFormList.Add(uiForm); } else { Debug.LogError("当前窗口正在打开"); } }
internal void RemoveThawingUIForm(IBaseUIForm uiForm) { if (_ThawingUIFormList.Contains(uiForm)) { _ThawingUIFormList.Remove(uiForm); } else { Debug.LogError("当前窗口正在冻结"); } }
/// <summary> /// 移除控制UI /// </summary> /// <param UIName="uiFrom"></param> internal void RemoveCtrlUIForm(IBaseUIForm uiFrom) { if (_CanCtrlUIForm.Contains(uiFrom)) { Debug.LogWarning("移除:" + uiFrom.name); lock (_Mutex) { _CanCtrlUIForm.Remove(uiFrom); } } }
public TBaseUI CancelShowUI <TBaseUI>() where TBaseUI : IBaseUIForm { string uiName = typeof(TBaseUI).Name; IBaseUIForm uiForm = UIMonoManager.GetCurrentOpenUI(uiName); if (uiForm == null) { uiForm = GetUI <TBaseUI>(); } UIMonoManager.Instance.CancelShowUI(uiForm); return(uiForm as TBaseUI); }
internal void CancelShowUI(IBaseUIForm optionUI) { if (_CurrentExecCommandDic.ContainsKey(optionUI.ID)) { _CurrentExecCommandDic[optionUI.ID].timer.SetTimer(0); Debug.Log(_CurrentExecCommandDic[optionUI.ID].timer.timer); } else { Debug.LogError("当前UI " + optionUI.name + "没有执行 ShowUI "); } }
public TBaseUI ThawUI <TBaseUI>(float time = 0, params object[] paramValues) where TBaseUI : IBaseUIForm { string uiName = typeof(TBaseUI).Name; IBaseUIForm uiForm = GetUI <TBaseUI>(); if (uiForm != null) { return(ThawUI(uiForm, time, paramValues) as TBaseUI); } return(null); }
/// <summary> /// 获得UI /// </summary> /// <param UIName="uiFormName"></param> /// <returns></returns> public static IBaseUIForm GetUI(string uiFormName) { IBaseUIForm baseUiForms = null; //UI窗体基类 if (string.IsNullOrEmpty(uiFormName)) { return(null); } //根据UI窗体的名称,加载到“所有UI窗体”缓存集合中 baseUiForms = Instance.LoadFormsToAllUIFormsCatch(uiFormName); return(baseUiForms); }
/// <summary> /// 根据UI窗体的名称,加载到“所有UI窗体”缓存集合中 /// 功能: 检查“所有UI窗体”集合中,是否已经加载过,否则才加载。 /// </summary> /// <param UIName="uiFormsName">UI窗体(预设)的名称</param> /// <returns></returns> private IBaseUIForm LoadFormsToAllUIFormsCatch(string uiFormsName) { IBaseUIForm baseUiResult = null; //加载的返回UI窗体基类 _AllCacheNormalUIFormDic.TryGetValue(uiFormsName, out baseUiResult); if (baseUiResult == null) { //加载指定名称的“UI窗体” baseUiResult = LoadUIForm(uiFormsName); } return(baseUiResult); }
public void Init(IBaseUIForm node) { if (node != null) { ID = node.ID; UIName = node.name; this.Node = node; } else { Reset(); } }
/// <summary> /// 打开UI /// </summary> /// <param UIName="openUIName">UI 名字</param> /// <param UIName="openOP"> 要打开UI的操作 </param> /// <param UIName="closeOP"> 当前UI的操作 </param> public TBaseUI OpenUI <TBaseUI>(float time = 0, params object[] paramVaules) where TBaseUI : IBaseUIForm { string uiName = typeof(TBaseUI).Name; IBaseUIForm uiForm = UIMonoManager.GetCurrentOpenUI(uiName); if (uiForm == null) { uiForm = GetUI <TBaseUI>(); return(OpenUI(uiForm, time, paramVaules) as TBaseUI); } return(uiForm as TBaseUI); }
/// <summary> /// 移除NewInstanceUI /// </summary> /// <param name="uiName">窗口id</param> private void RemoveNewInstanceCurrentOpenUI(IBaseUIForm uiForm) { int id = uiForm.ID; if (ExistNewInstanceUI(id)) { _CurrentOpenNewInstanceUIFormList.Remove(id); _CurrentOpenNewInstanceUIFormDic.Remove(id); } else { Debug.LogError("没有当前NewInstanceUI id :" + id); } }
/// <summary> /// 添加NewInstanceUI /// </summary> /// <param name="uiForm"></param> private void AddNewInstanceCurrentOpenUI(IBaseUIForm uiForm) { int id = uiForm.ID; if (ExistNewInstanceUI(id) == false) { _CurrentOpenNewInstanceUIFormList.Add(id); _CurrentOpenNewInstanceUIFormDic.Add(id, uiForm); } else { Debug.LogError("已经存在当前NewInstanceUI ui:" + uiForm + "id :" + id); } }
/// <summary> /// 递归关闭子节点 /// </summary> /// <param UIName="uiForm"></param> private void CircleClose(IBaseUIForm uiForm, float time, params object[] paramValues) { List <int> clildrenID = uiForm.UIFormDepend.childrenNodeID; for (int i = clildrenID.Count - 1; i >= 0; i--) { IBaseUIForm ui = uiForm.UIFormDepend.childrenNode[childrenNodeID[i]].Node; CircleClose(ui, time, paramValues); if (ui.UIStage != UIState.Hide) { ui.CloseUI(time, paramValues); } } }
/// <summary> /// 移除打开窗口 /// </summary> /// <param name="uiName"></param> private void RemoveNormalCurrentOpenUI(IBaseUIForm uiForm) { if (uiForm.CurrentUIType.UIFormsShowMode != UIFormShowMode.NewInstance) { if (IsOpenUI(uiForm.name)) { _CurrentOpenNormalUIFormList.Remove(uiForm.name); _CurrentOpenNormalUIFormDic.Remove(uiForm.name); } else { Debug.LogWarning("当前窗口没有打开 closeUI :" + uiForm.name); } } }
internal void AddDestroyCommand(IBaseUIForm optionUI) { if (_AllCacheNormalUIFormDic.ContainsKey(optionUI.name)) { _AllCacheNormalUIFormDic.Remove(optionUI.name); } RemoveCacheNewInstance(optionUI); UICommand openUIDown = _UICommandPool.Spawn(); openUIDown.InitDate(UICommandType.DestroyUI, optionUI, 0, null); _Invoker.AddCommand(openUIDown); //Debug.LogError("销毁 :" + optionUI.name); }
/// <summary> /// 添加打开窗口 /// </summary> /// <param name="uiForm"></param> private void AddNormalCurrentOpenUI(IBaseUIForm uiForm) { if (uiForm.CurrentUIType.UIFormsShowMode != UIFormShowMode.NewInstance) { string uiName = uiForm.name; if (IsOpenUI(uiName) == false) { _CurrentOpenNormalUIFormList.Add(uiName); _CurrentOpenNormalUIFormDic.Add(uiName, uiForm); } else { Debug.LogError("当前窗口已经打开 openUI :" + uiName); } } }