コード例 #1
0
ファイル: ShopPanel.cs プロジェクト: jsrhtc/Dmm_GoldIGDClient
        public override void Hide()
        {
            if (_contentTweener != null)
            {
                _contentTweener.Kill();
                _contentTweener = null;
            }

            if (_bgTweener != null)
            {
                _bgTweener.Kill();
                _bgTweener = null;
            }

            if (Content && Content.gameObject.activeSelf)
            {
                _contentTweener = Content
                                  .DOScale(new Vector3(0, 0, 1), HideAnimationTime)
                                  .SetEase(Ease.Linear)
                                  .OnComplete(() =>
                {
                    Content.gameObject.SetActive(false);
                    // 销毁商店面板。
                    Destroy(gameObject);
                    // 卸载不用的资源。
                    _uiController.NeedUnloadAsset();
                });
            }

            if (BgCover && BgCover.gameObject.activeSelf)
            {
                _bgTweener = BgCover
                             .DOFade(0, HideAnimationTime)
                             .SetEase(Ease.Linear)
                             .OnComplete(() => { BgCover.gameObject.SetActive(false); });
            }
        }
コード例 #2
0
 public void OnDisable()
 {
     _uiController.NeedUnloadAsset();
 }