예제 #1
0
 /// <summary>
 /// 关闭当前面板
 /// </summary>
 protected void CloseThisPanel(PanelEffectType closeEffectType = PanelEffectType.Close)
 {
     if (this.ThisPanel == PanelType.None)
     {
         Debug.Log("this panel is none can't close!"); return;
     }
     UICtrller.Instance.ClosePanel(this.ThisPanel, closeEffectType);
 }
예제 #2
0
 public void Open(PanelType type, PanelParamBase panelParam, PanelEffectType effectType, int depth)
 {
     this.ThisPanel = type;
     this.SetPanelDepth(depth);
     if (!this.IsInit) this.Init();
     this.InitPanel();
     this.Open(panelParam);
     this.PlayEffect(effectType);
 }
예제 #3
0
 public void ClosePanel(PanelType type, PanelEffectType closeEffectType = PanelEffectType.Close)
 {
     if (this.m_OpenedPanelDic.ContainsKey(type))
     {
         this.m_OpenedPanelDic[type].Close(closeEffectType);
         this.m_OpenedPanelDic.Remove(type);
     }
     else
     {
         Debug.LogError(type + " is null");
     }
 }
예제 #4
0
 public void Open(PanelType type, PanelParamBase panelParam, PanelEffectType effectType, int depth)
 {
     this.ThisPanel = type;
     this.SetPanelDepth(depth);
     if (!this.IsInit)
     {
         this.Init();
     }
     this.InitPanel();
     this.Open(panelParam);
     this.PlayEffect(effectType);
 }
예제 #5
0
 private void PlayEffect(PanelEffectType type)
 {
     if (this.m_PanelEffect == null)
     {
         if (type == PanelEffectType.Close || type == PanelEffectType.CloseByOpenOther)
         {
             this.CloseComplete();
         }
         else if (type == PanelEffectType.Open || type == PanelEffectType.OpenByCloseOther)
         {
             this.OpenComplete();
         }
     }
     else
     {
         this.m_PanelEffect.Play(type);
     }
 }
예제 #6
0
    public void Open(PanelType type, PanelParamBase panelParam = null, PanelEffectType openEffectType = PanelEffectType.Open)
    {
        PanelBase panel    = null;
        int       newDepth = 0;

        if (this.m_OpenedPanelDic.ContainsKey(type))
        {
            panel    = this.m_OpenedPanelDic[type];
            newDepth = panel.GetDepth();
        }
        else
        {
            panel = PoolMgr.Instance.GetPanel(type);
            if (panel == null)
            {
                Debug.Log("Panel is null " + type);
                return;
            }
            panel.MyTransform.localPosition = Vector3.zero;
            this.m_OpenedPanelDic.Add(type, panel);
            newDepth = this.GetTopDepth() + 2;//加2的原因是为了保险起见,因为有的时候只加1可能会出现面板重叠
        }
        panel.Open(type, panelParam, openEffectType, newDepth);
    }
예제 #7
0
 public void ClosePanel(PanelType type,PanelEffectType closeEffectType = PanelEffectType.Close)
 {
     if (this.m_OpenedPanelDic.ContainsKey(type))
     {
         this.m_OpenedPanelDic[type].Close(closeEffectType);
         this.m_OpenedPanelDic.Remove(type);
     }
     else
     {
         Debug.LogError(type + " is null");
     }
 }
예제 #8
0
 public void Open(PanelType type, PanelParamBase panelParam = null,PanelEffectType openEffectType = PanelEffectType.Open)
 {
     PanelBase panel = null;
     int newDepth = 0;
     if (this.m_OpenedPanelDic.ContainsKey(type))
     {
         panel = this.m_OpenedPanelDic[type];
         newDepth = panel.GetDepth();
     }
     else
     {
         panel = PoolMgr.Instance.GetPanel(type);
         if (panel == null)
         {
             Debug.Log("Panel is null " + type);
             return;
         }
         panel.MyTransform.localPosition = Vector3.zero;
         this.m_OpenedPanelDic.Add(type, panel);
         newDepth = this.GetTopDepth() + 2;//加2的原因是为了保险起见,因为有的时候只加1可能会出现面板重叠
     }
     panel.Open(type,panelParam, openEffectType, newDepth);
 }
예제 #9
0
 /// <summary>
 /// 关闭当前面板
 /// </summary>
 protected void CloseThisPanel(PanelEffectType closeEffectType = PanelEffectType.Close)
 {
     if (this.ThisPanel == PanelType.None) { Debug.Log("this panel is none can't close!"); return; }
     UICtrller.Instance.ClosePanel(this.ThisPanel, closeEffectType);
 }
예제 #10
0
 public virtual void Close(PanelEffectType type)
 {
     //在关闭面板时,禁用Collider,防止在播放动画的时候再次点到
     UIUtils.SetUIColliderEnable(this.MyTransform, false);
     this.PlayEffect(type);
 }
예제 #11
0
 private void PlayEffect(PanelEffectType type)
 {
     if (this.m_PanelEffect == null)
     {
         if (type == PanelEffectType.Close || type == PanelEffectType.CloseByOpenOther)
         {
             this.CloseComplete();
         }
         else if (type == PanelEffectType.Open || type == PanelEffectType.OpenByCloseOther)
         {
             this.OpenComplete();
         }
     }
     else
     {
         this.m_PanelEffect.Play(type);
     }
 }
예제 #12
0
 public virtual void Close(PanelEffectType type)
 {
     //在关闭面板时,禁用Collider,防止在播放动画的时候再次点到
     UIUtils.SetUIColliderEnable(this.MyTransform, false);
     this.PlayEffect(type);
 }