Example #1
0
 /// <summary>
 /// Create&ShowUI
 /// </summary>
 public void OpenPanel <T>(UILevel canvasLevel = UILevel.Common,
                           IUIData uiData      = null, UITransitionType transitionType = UITransitionType.NULL,
                           UIPanel view        = null, string assetBundleName          = null,
                           string prefabName   = null, UnityAction action              = null) where T : UIPanel
 {
     if (view.IsNotNull())
     {
         Push(view, transitionType);
     }
     if (transitionType == UITransitionType.CIRCLE)
     {
         if (!mIsChangingView)
         {
             mIsChangingView = true;
             mCircleMask.transform.parent.gameObject.Show();
             var tweenerCore = mCircleMask.transform.DOScale(new Vector3(1, 1, 1), 0.5f);
             DOTweenModuleUI.DOFade(mCircleMask, 1, 0.5f);
             tweenerCore.onComplete = delegate()
             {
                 action?.Invoke();
                 OpenUI(prefabName ?? GetUIBehaviourName <T>(), transitionType,
                        canvasLevel, uiData, assetBundleName, view.IsNotNull());
                 var t = mCircleMask.DOFade(0, 0.5f).SetEase(Ease.OutQuint);
                 t.onComplete = delegate()
                 {
                     mCircleMask.transform.parent.gameObject.Hide();
                     mCircleMask.transform.localScale = Vector3.zero;
                     mCircleMask.color = new Color(255, 255, 255, 0);
                     mIsChangingView   = false;
                 };
             };
         }
     }
     else if (transitionType == UITransitionType.CLOUD)
     {
         if (!mIsChangingView)
         {
             mIsChangingView = true;
             mCloudAnimationController.transform.parent.Show();
             mCloudAnimationController.PlayAnimation(CloudState.OPENANDCLOSE);
             IDisposable disposable = null;
             disposable = SimpleEventSystem.GetEvent <CloudOpenAnimation>().Subscribe(_ =>
             {
                 disposable.Dispose();
                 action?.Invoke();
                 OpenUI(prefabName ?? GetUIBehaviourName <T>(), transitionType,
                        canvasLevel, uiData, assetBundleName, view);
             });
         }
     }
     else
     {
         OpenUI(prefabName ?? GetUIBehaviourName <T>(), transitionType,
                canvasLevel, uiData, assetBundleName, view);
     }
 }
Example #2
0
        public static void Back(UIPanel currentPanel)
        {
            if (currentPanel.IsNotNull())
            {
                var panelSearchKeys = PanelSearchKeys.Allocate();

                panelSearchKeys.GameObjName = currentPanel.name;

                UIManager.Instance.CloseUI(panelSearchKeys);

                panelSearchKeys.Recycle2Cache();
            }

            Stack.Pop();
        }