Exemplo n.º 1
0
        public void HideFrame()
        {
            if (LogicHandler != null)
            {
                TimeModule.Instance.RemoveTimeaction(OnAfterShowFrameFinish);
                LogicHandler.OnHide();
            }

            if (Visible)
            {
                OnBeforeFrameDestroyEvent?.Invoke(this);

                float duration = 0;

                if (m_hideFrameParam.HideFrameWithAnimation)
                {
                    foreach (UITweenerBase ut in uiTweens)
                    {
                        if (ut.gameObject.activeInHierarchy && ut.m_triggerType == UITweenerBase.TweenTriggerType.OnHide)
                        {
                            duration = Mathf.Max(duration, ut.Duration + ut.Delay);
                            ut.ResetAndPlay();
                        }
                    }
                }
                TimeModule.Instance.SetTimeout(OnPostHideFrame, duration, false, false);

                //窗口在这里被没真正的隐藏,因为有Tween 没执行,遵循开闭原则,对外暴露已经关闭,对内等到真正Tween之后才进行关闭渲染
                this.m_frameVisible = false;
            }
        }