예제 #1
0
        /// <summary>
        /// Dos the animation show.
        /// </summary>
        /// <param name="ui">User interface.</param>
        private void DoAnimShow(UIManBase ui)
        {
            ui.LockInput();

            if (ui.motionShow == UIMotion.CustomMecanimAnimation)
            {
                // Custom animation use animator
                ui.CanvasGroup.alpha = 1;
                ui.animRoot.EnableAndPlay(UIManDefine.ANIM_SHOW);
            }
            else if (ui.motionShow == UIMotion.CustomScriptAnimation)
            {
                // Custom animation use overrided function
                ui.animRoot.Disable();
                StartCoroutine(DelayDequeueDialog(ui.AnimationShow(), ui, true));
            }
            else
            {
                // Simple tween
                ui.animRoot.Disable();
                Vector3 initPos = GetTargetPosition(ui.motionShow, UIManDefine.ARR_SHOW_TARGET_POS);

                ui.RectTransform.localPosition = initPos;
                ui.CanvasGroup.alpha           = 0;
                // Tween position
                if (ui.motionShow != UIMotion.None)
                {
                    UITweener.Move(ui.gameObject, ui.animTime, ui.showPosition);
                }

                UITweener.Alpha(ui.gameObject, ui.animTime, 0f, 1f).SetOnComplete(() => {
                    ui.OnShowComplete();
                    OnShowUIComplete(ui);

                    if (ui.GetUIBaseType() == UIBaseType.Dialog)
                    {
                        this.IsInDialogTransition = false;
                    }

                    ui.UnlockInput();
                    DoAnimIdle(ui);
                });
            }
        }
예제 #2
0
        /// <summary>
        /// Dos the animation show.
        /// </summary>
        /// <param name="ui">User interface.</param>
        void DoAnimShow(UIManBase ui)
        {
            ui.LockInput();

            if (ui.motionShow == UIMotion.CUSTOM_MECANIM_ANIMATION)               //Custom animation use animator
            {
                ui.animRoot.EnableAndPlay(UIManDefine.ANIM_SHOW);
            }
            else if (ui.motionShow == UIMotion.CUSTOM_SCRIPT_ANIMATION)                 //Custom animation use overrided function
            {
                ui.animRoot.Disable();
                StartCoroutine(DelayDequeueDialog(ui.AnimationShow(), ui, true));
            }
            else                 // Simple tween
            {
                ui.animRoot.Disable();
                Vector3 initPos = GetTargetPosition(ui.motionShow, UIManDefine.ARR_SHOW_TARGET_POS);

                ui.RectTrans.localPosition = initPos;
                ui.GroupCanvas.alpha       = 0;

                // Tween position
                if (ui.motionShow != UIMotion.NONE)
                {
                    LeanTween.move(ui.RectTrans, ui.showPosition, ui.animTime)
                    .setEase(LeanTweenType.linear);
                }

                // Tween alpha
                LeanTween.value(ui.gameObject, ui.UpdateAlpha, 0.0f, 1.0f, ui.animTime)
                .setEase(LeanTweenType.linear)
                .setOnComplete(show => {
                    ui.OnShowComplete();
                    OnShowUIComplete(ui);
                    if (ui.GetUIBaseType() == UIBaseType.DIALOG)
                    {
                        IsInDialogTransition = false;
                    }
                    ui.UnlockInput();
                    DoAnimIdle(ui);
                });
            }
        }