Beispiel #1
0
 public sealed override void OnRemove()
 {
     if (UIResourceDefine.GetWindowPop(base.m_mediatorName) && (this.mFrontEventCtrl != null))
     {
         this.mFrontEventCtrl.Play(false);
         TweenSettingsExtensions.SetUpdate <Sequence>(TweenSettingsExtensions.AppendCallback(TweenSettingsExtensions.AppendInterval(this.GetSeq(), 0.15f), new TweenCallback(this, this.< OnRemove > m__0)), true);
     }
     else
     {
         if (this._MonoView != null)
         {
             this._MonoView.SetActive(false);
         }
         WindowUI.PopClose();
     }
     this.OnRemoveAfter();
 }
Beispiel #2
0
    public override void OnRegister()
    {
        this.ClearSeq();
        this.OnRegisterBefore();
        GameObject obj2 = null;
        bool       flag = mCacheUIPanel.TryGetValue(base.m_mediatorName, out WindowCacheData data);

        if (data != null)
        {
            obj2 = data.obj;
        }
        if (obj2 == null)
        {
            this._MonoView = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("UIPanel/" + this.UIPath));
            if (UIResourceDefine.GetWindowPop(base.m_mediatorName))
            {
                this._popupparent      = Object.Instantiate <GameObject>(ResourceManager.Load <GameObject>("UIPanel/ACommon/PopUpParent"));
                this._popupparent.name = base.m_mediatorName;
                RectTransform transform = this._popupparent.transform as RectTransform;
                transform.SetParent(GetParent(base.m_mediatorName));
                transform.localPosition = Vector3.zero;
                transform.offsetMin     = Vector2.zero;
                transform.offsetMax     = Vector2.zero;
                this.mFrontEventCtrl    = this._popupparent.GetComponent <FrontEventCtrl>();
                mFrontEventList.Add(base.m_mediatorName, this.mFrontEventCtrl);
                this.mFrontEventCtrl.Play(true);
                this._MonoView.SetParentNormal(this._popupparent.transform);
            }
            else
            {
                this._MonoView.SetParentNormal(GetParent(base.m_mediatorName));
            }
            base.ViewComponent = this._MonoView;
            if (!flag)
            {
                WindowCacheData data2 = new WindowCacheData {
                    name     = base.m_mediatorName,
                    obj      = this._MonoView,
                    lasttime = Time.realtimeSinceStartup
                };
                mCacheUIPanel.Add(base.m_mediatorName, data2);
            }
            else
            {
                mCacheUIPanel[base.m_mediatorName].obj      = this._MonoView;
                mCacheUIPanel[base.m_mediatorName].lasttime = Time.realtimeSinceStartup;
            }
            this.OnRegisterOnce();
        }
        else
        {
            mCacheUIPanel[base.m_mediatorName].lasttime = Time.realtimeSinceStartup;
            this._MonoView = obj2;
            this._MonoView.SetActive(true);
            this._MonoView.transform.SetAsLastSibling();
            mFrontEventList.TryGetValue(base.m_mediatorName, out this.mFrontEventCtrl);
            if (this.mFrontEventCtrl != null)
            {
                this.mFrontEventCtrl.gameObject.SetActive(true);
                this.mFrontEventCtrl.transform.SetAsLastSibling();
                this.mFrontEventCtrl.Play(true);
            }
        }
        this.OnRegisterEvery();
        this.OnLanguageChange();
    }