Exemple #1
0
    public void Hide(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
    {
        if (alwaysKeepVisible)
        {
            return;
        }
        m_hideFlags |= (int)hideFlag;
        if (m_hideFlags == 0 || m_isHided)
        {
            return;
        }
        m_isHided = true;
        if (m_canvas != null)
        {
            m_canvas.enabled = false;
        }

        for (int i = 0; i < m_relatedScenes.Count; i++)
        {
            UIUtility.SetGameObjectLayer(m_relatedScenes[i], 31);
            SetSceneCameraEnable(i, false);
        }
        HideComponent();
        if (revertToHideEvent != enUIEventID.None)
        {
            Singleton <UIEventManager> .GetInstance().DispatchUIEvent(revertToHideEvent);
        }
        if (dispatchVisibleChangedEvent)
        {
            DispatchVisibleChangedEvent();
        }
    }
 public void Appear(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
 {
     if (this.m_alwaysKeepVisible)
     {
         return;
     }
     this.m_hideFlags &= (int)(~(int)hideFlag);
     if (this.m_hideFlags != 0 || !this.m_isHided)
     {
         return;
     }
     this.m_isHided = false;
     if (this.m_canvas != null)
     {
         this.m_canvas.enabled      = true;
         this.m_canvas.sortingOrder = this.m_sortingOrder;
     }
     if (this.m_graphicRaycaster && !this.m_disableInput)
     {
         this.m_graphicRaycaster.enabled = true;
     }
     for (int i = 0; i < this.m_relatedScenes.get_Count(); i++)
     {
         CUIUtility.SetGameObjectLayer(this.m_relatedScenes.get_Item(i), 18);
         this.SetSceneCameraEnable(i, true);
     }
     this.AppearComponent();
     this.DispatchRevertVisibleFormEvent();
     if (dispatchVisibleChangedEvent)
     {
         this.DispatchVisibleChangedEvent();
     }
 }
Exemple #3
0
    public void Appear(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
    {
        if (alwaysKeepVisible)
        {
            return;
        }

        m_hideFlags &= (int)(~(int)hideFlag);
        if (m_hideFlags != 0 || !m_isHided)
        {
            return;
        }
        m_isHided = false;
        if (m_canvas != null)
        {
            m_canvas.enabled      = true;
            m_canvas.sortingOrder = m_sortingOrder;
        }

        for (int i = 0; i < m_relatedScenes.Count; ++i)
        {
            UIUtility.SetGameObjectLayer(this.m_relatedScenes[i], 18);
            SetSceneCameraEnable(i, true);
        }
        AppearComponent();
        DispatchRevertVisibleFormEvent();
        if (dispatchVisibleChangedEvent)
        {
            DispatchVisibleChangedEvent();
        }
    }
 public void Hide(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
 {
     if (this.m_alwaysKeepVisible)
     {
         return;
     }
     this.m_hideFlags |= (int)hideFlag;
     if (this.m_hideFlags == 0 || this.m_isHided)
     {
         return;
     }
     this.m_isHided = true;
     if (this.m_canvas != null)
     {
         this.m_canvas.enabled = false;
     }
     if (this.m_graphicRaycaster)
     {
         this.m_graphicRaycaster.enabled = false;
     }
     for (int i = 0; i < this.m_relatedScenes.get_Count(); i++)
     {
         CUIUtility.SetGameObjectLayer(this.m_relatedScenes.get_Item(i), 31);
         this.SetSceneCameraEnable(i, false);
     }
     this.HideComponent();
     if (this.m_revertToHideEvent != enUIEventID.None)
     {
         Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(this.m_revertToHideEvent);
     }
     if (dispatchVisibleChangedEvent)
     {
         this.DispatchVisibleChangedEvent();
     }
 }
Exemple #5
0
 public void Hide(enFormHideFlag hideFlag = 1, bool dispatchVisibleChangedEvent = true)
 {
     if (!this.m_alwaysKeepVisible)
     {
         this.m_hideFlags |= hideFlag;
         if ((this.m_hideFlags != 0) && !this.m_isHided)
         {
             this.m_isHided = true;
             if (this.m_canvas != null)
             {
                 this.m_canvas.enabled = false;
             }
             if (this.m_graphicRaycaster != null)
             {
                 this.m_graphicRaycaster.enabled = false;
             }
             for (int i = 0; i < this.m_relatedScenes.Count; i++)
             {
                 CUIUtility.SetGameObjectLayer(this.m_relatedScenes[i], 0x1f);
                 this.SetSceneCameraEnable(i, false);
             }
             this.HideComponent();
             if (this.m_revertToHideEvent != enUIEventID.None)
             {
                 Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(this.m_revertToHideEvent);
             }
             if (dispatchVisibleChangedEvent)
             {
                 this.DispatchVisibleChangedEvent();
             }
         }
     }
 }
Exemple #6
0
 public void Appear(enFormHideFlag hideFlag = 1, bool dispatchVisibleChangedEvent = true)
 {
     if (!this.m_alwaysKeepVisible)
     {
         this.m_hideFlags &= ~hideFlag;
         if ((this.m_hideFlags == 0) && this.m_isHided)
         {
             this.m_isHided = false;
             if (this.m_canvas != null)
             {
                 this.m_canvas.enabled      = true;
                 this.m_canvas.sortingOrder = this.m_sortingOrder;
             }
             if ((this.m_graphicRaycaster != null) && !this.m_disableInput)
             {
                 this.m_graphicRaycaster.enabled = true;
             }
             for (int i = 0; i < this.m_relatedScenes.Count; i++)
             {
                 CUIUtility.SetGameObjectLayer(this.m_relatedScenes[i], 0x12);
                 this.SetSceneCameraEnable(i, true);
             }
             this.AppearComponent();
             this.DispatchRevertVisibleFormEvent();
             if (dispatchVisibleChangedEvent)
             {
                 this.DispatchVisibleChangedEvent();
             }
         }
     }
 }
Exemple #7
0
        /// <summary>
        /// 界面显示操作
        /// </summary>
        /// <param name="hideFlag"></param>
        /// <param name="dispatchVisibleChangedEvent"></param>
        public void Appear(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
        {
            if (!this.m_isAlwaysKeepVisible)
            {
                this.m_hideFlags &= (~(int)hideFlag);
                if ((this.m_hideFlags == 0) && this.m_isHided)
                {
                    this.m_isHided = false;
                    if (this.m_Canvas != null)
                    {
                        this.m_Canvas.enabled      = true;
                        this.m_Canvas.sortingOrder = this.m_sortingOrder;
                    }
                    if ((this.m_graphicRaycaster != null) && !this.m_disableInput)
                    {
                        this.m_graphicRaycaster.enabled = true;
                    }

                    AppearComponent();
                    //DispatchRevertVisibleFormEvent();

                    //if(this.dispatchVisibleChangedEvent != null)
                    //{
                    //    this.DispatchVisibleChangedEvent();
                    //}
                }
            }
        }
Exemple #8
0
        /// <summary>
        /// 界面隐藏操作
        /// </summary>
        public void Hide(enFormHideFlag hideFlag = enFormHideFlag.HideByCustom, bool dispatchVisibleChangedEvent = true)
        {
            if (!this.m_isAlwaysKeepVisible)
            {
                this.m_hideFlags |= (int)hideFlag;
                if (this.m_hideFlags != 0 && !this.m_isHided)
                {
                    this.m_isHided = true;
                    if (this.m_Canvas != null)
                    {
                        this.m_Canvas.enabled = false;
                    }
                    if (this.m_graphicRaycaster != null)
                    {
                        this.m_graphicRaycaster.enabled = false;
                    }

                    HideComponent();

                    // TODO 发送隐藏事件通知
                }
            }
        }