public override void OnDestroy(InternalUIPanel panel) { cacheItem = null; cacheRoot = null; cachePool.Clear(); activePool.Clear(); }
/// <summary> /// 创建界面节点 /// </summary> /// <param name="panel"></param> /// <param name="trans"></param> /// <returns></returns> public static void CreateUIPanelTrans(InternalUIPanel panel) { RectTransform panelRootTrans = UILocate.UICenter.GetUILayerTrans(panel.Layer, panel.CanvasType); if (panelRootTrans == null) { UILocate.Log.LogError("创建界面节点失败,没有找到层级节点>>>", panel.Layer, panel.CanvasType); return; } if (string.IsNullOrEmpty(panel.UIPrefabName)) { UILocate.Log.LogError("创建界面节点失败,没有声明预制体>>>", panel.UIPrefabName); return; } GameObject goAsset = LoadHelper.LoadPrefab(panel.UIPrefabName); if (goAsset == null) { UILocate.Log.LogError("创建界面节点失败,没有找到预制体>>>", panel.UIPrefabName); return; } GameObject panGo = GameObject.Instantiate(goAsset); panGo.transform.SetParent(panelRootTrans, false); panGo.transform.Reset(); //设置节点 panel.SetTransform(panGo.transform); panel.Awake(); }
public override void OnHide(InternalUIPanel panel) { if (needHideRecycle) { RecycleAll(); } }
public override void OnShowPanel(UIPanelId panelId, InternalUIPanel panel) { if (panel.DefaultShowRule == UIShowRule.Overlay_NoNeedBack || panel.DefaultShowRule == UIShowRule.HideOther_NoNeedBack) { return; } stack.Push(new PanelStack(panelId, panel)); }
public void HidePanel(UIPanelId panelId, InternalUIPanel panel) { if (!CheckRules.Contains(panel.DefaultShowRule)) { return; } OnHidePanel(panelId, panel); }
/// <summary> /// 创建界面节点 /// </summary> /// <param name="panel"></param> /// <param name="trans"></param> /// <returns></returns> public static void CreateUIPanelTrans(InternalUIPanel panel, Transform panelTrans) { if (panelTrans == null) { UILocate.Log.LogError("创建界面节点失败,没有节点>>>"); return; } //设置节点 panel.SetTransform(panelTrans.transform); panel.Awake(); }
public override void OnAwake(InternalUIPanel panel) { base.OnAwake(panel); if (string.IsNullOrEmpty(cacheRootPath)) { cacheRoot = panel.transform; return; } cacheRoot = panel.transform.Find(cacheRootPath); if (cacheRoot == null) { UILocate.Log.LogError("缓存对象绑定失败,没有缓存存放路径!!", cacheRootPath); } }
public override void OnHidePanel(UIPanelId panelId, InternalUIPanel panel) { if (stack.Count <= 0) { return; } PanelStack panelStack = stack.Peek(); //栈顶界面关闭 if (panelStack.panelId == panelId) { //就剩一个了 if (stack.Count <= 1) { return; } stack.Pop(); PanelStack nextPanel = stack.Peek(); UILocate.UI.Show(nextPanel.panelId); } }
public virtual void OnHide(InternalUIPanel panel) { }
public virtual void OnAfterShow(InternalUIPanel panel) { }
public virtual void OnBeforeShow(InternalUIPanel panel) { }
public virtual void OnAwake(InternalUIPanel panel) { this._Panel = panel; }
public override void OnDestroy(InternalUIPanel panel) { _Com = null; }
public PanelStack(UIPanelId panelId, InternalUIPanel panel) { this.panelId = panelId; this.panel = panel; }
public override void OnAwake(InternalUIPanel panel) { base.OnAwake(panel); _Com = _ComTrans.GetComponent <T>(); }
public virtual void OnDestroy(InternalUIPanel panel) { }
public virtual void OnHidePanel(UIPanelId panelId, InternalUIPanel panel) { }
public virtual void OnShowPanel(UIPanelId panelId, InternalUIPanel panel) { }
public override void OnShowPanel(UIPanelId panelId, InternalUIPanel panel) { UILocate.UI.HideAllActivePanel(); }
public override void OnAwake(InternalUIPanel panel) { base.OnAwake(panel); RefreshBind(); }