Exemple #1
0
        private async void CloseAsync(string uiName, Action callback)
        {
            await WaitAnimationFinished();

            MaskManager.Instance.SetActive(true);

            for (int i = 0; i < showList.Count; i++)
            {
                ChildUI tempChildUI = showList[i];
                if (tempChildUI != null && tempChildUI.UIContext.UIData.UIName == uiName)
                {
                    showList.RemoveAt(i);
                    break;
                }
            }

            ChildUI childUI = null;

            if (childDic.TryGetValue(uiName, out childUI))
            {
                await childUI.DisableAsync();
            }

            MaskManager.Instance.SetActive(false);

            callback?.Invoke();
        }
Exemple #2
0
 public void Disable()
 {
     for (int i = 0; i < showList.Count; i++)
     {
         ChildUI childUI = showList[i];
         if (childUI != null && !childUI.UIContext.UIData.HasAnimation)
         {
             childUI.DisableAsync().ConfigureAwait(true);
         }
     }
 }
Exemple #3
0
 public void BeforeDisable()
 {
     //父UI执行Disable之前,有动画的子UI需要播放退场动画
     for (int i = 0; i < showList.Count; i++)
     {
         ChildUI childUI = showList[i];
         if (childUI != null && childUI.UIContext.UIData.HasAnimation)
         {
             childUI.DisableAsync().ConfigureAwait(true);
         }
     }
 }