Exemple #1
0
        public override void Show(System.Action complete)
        {
            Holoville.HOTween.Core.TweenDelegate.TweenCallback onLoadAnimationOver = () =>
            {
                if (complete != null)
                {
                    complete();
                }
            };
            DialogAnimationType type = animationType;

            this._init();
            // パネル表示時→ローディングアニメ非表示
            //Indicator.Hide(type, true, complete);
            RectTransform trans = gameObject.GetComponent <RectTransform>();

            switch (type)
            {
            case DialogAnimationType.Down:
                HOTween.To(panel as RectTransform, 0.3f,
                           new TweenParms().Prop("anchoredPosition", _savePosition)
                           .OnComplete(onLoadAnimationOver));
                break;

            case DialogAnimationType.Middle:
                HOTween.To(panel, 0.3f, new TweenParms().Prop("localScale", new Vector3(1f, 1f, 1f)).OnComplete(onLoadAnimationOver));
                break;

            case DialogAnimationType.Fade:
                HOTween.To(canvasGroup, 0.3f,
                           new TweenParms().Prop("alpha", 1).OnComplete(onLoadAnimationOver));
                break;
            }
        }
        // 共通アニメーション:DialogManagerから設定
        public void SetDefaultDialogAnimationSetting(GameObject dialogBg, DialogAnimation script)
        {
            // target image
            {
                TargetImage      = dialogBg.GetComponent <Image>();
                _defaultPosVec   = TargetImage.rectTransform.position;
                _defaultScaleVec = TargetImage.rectTransform.localScale;
                dialogBg.SetActive(false);

                // CanvasGroup設定されてないなら設定
                if (TargetImage.gameObject.GetComponent <CanvasGroup>() == null)
                {
                    TargetImage.gameObject.AddComponent <CanvasGroup>();
                }
            }

            // setting
            {
                AnimationType  = script.AnimationType;
                IsFrameOut     = script.IsFrameOut;
                AnimationTime  = script.AnimationTime;
                AnimationCurve = script.AnimationCurve;
                FadeCurve      = script.FadeCurve;
            }
        }
        internal static UIModalTransitionStyle ToUiModalTransition(this DialogAnimationType type)
        {
            switch (type)
            {
            case DialogAnimationType.SystemCoverVertical:
                return(UIModalTransitionStyle.CoverVertical);

            case DialogAnimationType.SystemFlipHorizontal:
                return(UIModalTransitionStyle.FlipHorizontal);

            default:
                return(UIModalTransitionStyle.CrossDissolve);
            }
        }
 internal static bool IsSystemAnimation(this DialogAnimationType type)
 {
     return(type == DialogAnimationType.SystemCrossDissolve ||
            type == DialogAnimationType.SystemCoverVertical ||
            type == DialogAnimationType.SystemFlipHorizontal);
 }