Esempio n. 1
0
 public override void OnDestroy(InternalUIPanel panel)
 {
     cacheItem = null;
     cacheRoot = null;
     cachePool.Clear();
     activePool.Clear();
 }
Esempio n. 2
0
        /// <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();
        }
Esempio n. 3
0
 public override void OnHide(InternalUIPanel panel)
 {
     if (needHideRecycle)
     {
         RecycleAll();
     }
 }
Esempio n. 4
0
 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));
 }
Esempio n. 5
0
 public void HidePanel(UIPanelId panelId, InternalUIPanel panel)
 {
     if (!CheckRules.Contains(panel.DefaultShowRule))
     {
         return;
     }
     OnHidePanel(panelId, panel);
 }
Esempio n. 6
0
 /// <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();
 }
Esempio n. 7
0
 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);
     }
 }
Esempio n. 8
0
        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);
            }
        }
Esempio n. 9
0
 public virtual void OnHide(InternalUIPanel panel)
 {
 }
Esempio n. 10
0
 public virtual void OnAfterShow(InternalUIPanel panel)
 {
 }
Esempio n. 11
0
 public virtual void OnBeforeShow(InternalUIPanel panel)
 {
 }
Esempio n. 12
0
 public virtual void OnAwake(InternalUIPanel panel)
 {
     this._Panel = panel;
 }
Esempio n. 13
0
 public override void OnDestroy(InternalUIPanel panel)
 {
     _Com = null;
 }
Esempio n. 14
0
 public PanelStack(UIPanelId panelId, InternalUIPanel panel)
 {
     this.panelId = panelId;
     this.panel   = panel;
 }
Esempio n. 15
0
 public override void OnAwake(InternalUIPanel panel)
 {
     base.OnAwake(panel);
     _Com = _ComTrans.GetComponent <T>();
 }
Esempio n. 16
0
 public virtual void OnDestroy(InternalUIPanel panel)
 {
 }
Esempio n. 17
0
 public virtual void OnHidePanel(UIPanelId panelId, InternalUIPanel panel)
 {
 }
Esempio n. 18
0
 public virtual void OnShowPanel(UIPanelId panelId, InternalUIPanel panel)
 {
 }
Esempio n. 19
0
 public override void OnShowPanel(UIPanelId panelId, InternalUIPanel panel)
 {
     UILocate.UI.HideAllActivePanel();
 }
Esempio n. 20
0
 public override void OnAwake(InternalUIPanel panel)
 {
     base.OnAwake(panel);
     RefreshBind();
 }