コード例 #1
0
        /// <summary>
        /// Applies the TweenerSettings to this tweener, this will clear OnX callbacks <code>e.g. OnStart(<b>action</b>) if the relevant TweenerSetting events have listeners</code>
        /// </summary>
        /// <param name="tweener">This</param>
        /// <param name="settings">Tweener settings to apply</param>
        /// <returns>The modified tweener</returns>
        public static Tweener ApplySettings([NotNull] this Tweener tweener, TweenerSettings settings)
        {
            if (tweener == null)
            {
                throw new ArgumentNullException(nameof(tweener));
            }
            if (settings == null)
            {
                return(tweener);
            }
            tweener.SetDelay(settings.Delay);

            if (settings.StopMotionEase)
            {
                tweener.SetEase(EaseFactory.StopMotion(settings.StopMotionEaseFrameRate, settings.EaseFunction));
            }
            else
            {
                tweener.SetEase(settings.EaseFunction, settings.EaseOvershoot, settings.EasePeriod);
            }

            tweener.SetAutoKill(settings.AutoKill);

            tweener.SetLoops(settings.Loops, settings.LoopType);
            tweener.SetUpdate(settings.UpdateType);

            // Events
            if (settings.OnStart.GetPersistentEventCount() > 0)
            {
                tweener.OnStart(() => settings.OnStart?.Invoke());
            }
            if (settings.OnKill.GetPersistentEventCount() > 0)
            {
                tweener.OnKill(() => settings.OnKill?.Invoke());
            }
            if (settings.OnPlay.GetPersistentEventCount() > 0)
            {
                tweener.OnPlay(() => settings.OnPlay?.Invoke());
            }
            if (settings.OnPause.GetPersistentEventCount() > 0)
            {
                tweener.OnPause(() => settings.OnPause?.Invoke());
            }
            if (settings.OnRewind.GetPersistentEventCount() > 0)
            {
                tweener.OnRewind(() => settings.OnRewind?.Invoke());
            }
            if (settings.OnStepComplete.GetPersistentEventCount() > 0)
            {
                tweener.OnStepComplete(() => settings.OnStepComplete?.Invoke());
            }
            if (settings.OnComplete.GetPersistentEventCount() > 0)
            {
                tweener.OnComplete(() => settings.OnComplete?.Invoke());
            }
            return(tweener);
        }
コード例 #2
0
ファイル: PropStatus.cs プロジェクト: raomuqi/vstgit
 void Initialize()
 {
     meshRender     = GetComponent <MeshRenderer>();
     matBlock       = new MaterialPropertyBlock();
     flashDuration += Random.Range(-0.5f, 0.5f);
     tweenFlash     = DOTween.To(() => flashIns, x => flashIns = x, 1, flashDuration)
                      .SetAutoKill(false).SetEase(EaseFactory.StopMotion(5, Ease.InOutCubic))
                      .SetLoops(-1, LoopType.Yoyo).Pause();
 }
コード例 #3
0
    IEnumerator TutorialCloseCoroutine()
    {
        tPopOut = DOTween.Sequence();
        tPopOut.Append(tutorialWindow.DOAnchorPos(tutorialStartPos.position, speed, true))
        .SetEase(EaseFactory.StopMotion(8, Ease.OutQuint))
        .Insert(0, tutorialWindow.DOScale(minSize, speed));
        yield return(tPopOut.WaitForCompletion());

        tutorialEnabled = false;
    }
コード例 #4
0
    IEnumerator TutorialOpenCoroutine()
    {
        tPopUp = DOTween.Sequence();
        tPopUp.Append(tutorialWindow.transform.DOMove(tutorialTargetPos.position, speed, true))
        //tPopUp.Append(tutorialWindow.DOAnchorPos(tutorialTargetPos.position, speed, true))
        .SetEase(EaseFactory.StopMotion(8, Ease.OutQuint))
        .Insert(0, tutorialWindow.DOScale(fullSize, speed));
        yield return(tPopUp.WaitForCompletion());

        tutorialEnabled = true;
    }
コード例 #5
0
    IEnumerator CreditOpenCoroutine()
    {
        cPopUp = DOTween.Sequence();
        cPopUp.Append(creditsWindow.transform.DOMove(creditsTargetPos.position, speed, true))
        //cPopUp.Append(creditsWindow.DOAnchorPos(creditsTargetPos.position, speed, true) )
        .SetEase(EaseFactory.StopMotion(8, Ease.OutQuint))
        .Insert(0, creditsWindow.DOScale(fullSize, speed));
        yield return(cPopUp.WaitForCompletion());

        creditsEnabled = true;
    }
コード例 #6
0
    IEnumerator CreditCloseCoroutine()
    {
        cPopOut = DOTween.Sequence();
        cPopOut.Append(creditsWindow.DOAnchorPos(creditsStartPos.position, speed, true))
        .SetEase(EaseFactory.StopMotion(8, Ease.OutQuint))
        .Insert(0, creditsWindow.DOScale(minSize, speed));

        yield return(cPopOut.WaitForCompletion());

        creditsEnabled = false;
    }
コード例 #7
0
    private static int StopMotion(IntPtr L)
    {
        int result;

        try
        {
            int num = LuaDLL.lua_gettop(L);
            if (num == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(EaseFunction)))
            {
                int          motionFps = (int)LuaDLL.lua_tonumber(L, 1);
                LuaTypes     luaTypes  = LuaDLL.lua_type(L, 2);
                EaseFunction customEase;
                if (luaTypes != LuaTypes.LUA_TFUNCTION)
                {
                    customEase = (EaseFunction)ToLua.ToObject(L, 2);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 2);
                    customEase = (DelegateFactory.CreateDelegate(typeof(EaseFunction), func) as EaseFunction);
                }
                EaseFunction ev = EaseFactory.StopMotion(motionFps, customEase);
                ToLua.Push(L, ev);
                result = 1;
            }
            else if (num == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(AnimationCurve)))
            {
                int            motionFps2 = (int)LuaDLL.lua_tonumber(L, 1);
                AnimationCurve animCurve  = (AnimationCurve)ToLua.ToObject(L, 2);
                EaseFunction   ev2        = EaseFactory.StopMotion(motionFps2, animCurve);
                ToLua.Push(L, ev2);
                result = 1;
            }
            else if (num == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(Ease?)))
            {
                int          motionFps3 = (int)LuaDLL.lua_tonumber(L, 1);
                Ease?        ease       = (Ease?)ToLua.ToObject(L, 2);
                EaseFunction ev3        = EaseFactory.StopMotion(motionFps3, ease);
                ToLua.Push(L, ev3);
                result = 1;
            }
            else
            {
                result = LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.EaseFactory.StopMotion");
            }
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
コード例 #8
0
    void Start()
    {
        Tween t = target.DOMove(new Vector3(0, 4, 0), 2);

        // Tween t = target.DORotate(new Vector3(0,180,0), 2);
        if (easeType == EaseType.AnimationCurve)
        {
            t.SetEase(EaseFactory.StopMotion(stopMotionFPS, easeCurve));
        }
        else if (easeType == EaseType.Ease)
        {
            t.SetEase(EaseFactory.StopMotion(stopMotionFPS, ease));
        }
        else
        {
            t.SetEase(EaseFactory.StopMotion(stopMotionFPS));
        }
        t.SetAutoKill(false).SetLoops(3, LoopType.Yoyo).Pause();
    }
コード例 #9
0
        public override void OnEnter()
        {
            var _target = Fsm.GetOwnerDefaultTarget(gameObject);

            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetRecyclable(setRecycle.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenCameraRectTo]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>\",this.Owner");
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(Fsm.GetOwnerDefaultTarget(gameObject));
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;


            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }


            // Easy part to edit for other DotTween actions --->

            switch (dotweenTypeSelect)
            {
            case doTweenType.pixelRect:
                _target.GetComponent <Camera>().DOPixelRect(to.Value, duration.Value).SetAs(setFinal);
                break;

            case doTweenType.rect:
                _target.GetComponent <Camera>().DORect(to.Value, duration.Value).SetAs(setFinal);
                break;
            }



            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #10
0
ファイル: CraftStatus.cs プロジェクト: raomuqi/vstgit
 void Initialize()
 {
     meshRender = GetComponent <MeshRenderer>();
     matBlock   = new MaterialPropertyBlock();
     tweenState = DOTween.To(() => stateIns, x => stateIns = x, 1, 2.0f).SetAutoKill(false).SetEase(EaseFactory.StopMotion(5, Ease.OutFlash)).Pause();
 }
コード例 #11
0
        public override void OnEnter()
        {
            var _target = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_target != null)
            {
                if (transforms.Length >= 2)
                {
                    waypoints = new Vector3[transforms.Length];
                    for (int i = 0; i < transforms.Length; i++)
                    {
                        if (transforms[i].IsNone)
                        {
                            waypoints[waypoints.Length - 1 - i] = vectors[i].IsNone ? Vector3.zero : vectors[i].Value;
                        }
                        else
                        {
                            if (transforms[i].Value == null)
                            {
                                waypoints[waypoints.Length - 1 - i] = vectors[i].IsNone ? Vector3.zero : vectors[i].Value;
                            }
                            else
                            {
                                waypoints[waypoints.Length - 1 - i] = (dotweenTypeSelect == doTweenType.DoPath ? transforms[i].Value.transform.position : transforms[i].Value.transform.localPosition) + (vectors[i].IsNone ? Vector3.zero : vectors[i].Value);
                            }
                        }
                    }
                }
            }

            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }


            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenPathTransformTo]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(Fsm.GetOwnerDefaultTarget(gameObject));
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;

            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }



            switch (pathTypeSelect)
            {
            case doPathType.CatmullRom:
                pathTypeSelected = PathType.CatmullRom;
                break;

            case doPathType.Linear:
                pathTypeSelected = PathType.Linear;
                break;
            }


            switch (pathModeSelect)
            {
            case doPathMode.Full3D:
                pathModeSelected = PathMode.Full3D;
                break;

            case doPathMode.Ignore:
                pathModeSelected = PathMode.Ignore;
                break;

            case doPathMode.Sidescroller2D:
                pathModeSelected = PathMode.Sidescroller2D;
                break;

            case doPathMode.TopDown2D:
                pathModeSelected = PathMode.TopDown2D;
                break;
            }


            // Easy part to edit for other DotTween actions --->

            switch (dotweenTypeSelect)
            {
            case doTweenType.DoPath:

                if (gizmoOff.Value == true)
                {
                    _target.transform.DOPath(waypoints, duration.Value, pathTypeSelected, pathModeSelected, resolution.Value).SetAs(setFinal);
                }

                else
                {
                    _target.transform.DOPath(waypoints, duration.Value, pathTypeSelected, pathModeSelected, resolution.Value, gizmoColor.Value).SetAs(setFinal);
                }
                break;

            case doTweenType.DoLocalPath:
                if (gizmoOff.Value == true)
                {
                    _target.transform.DOLocalPath(waypoints, duration.Value, pathTypeSelected, pathModeSelected, resolution.Value).SetAs(setFinal);
                }
                else
                {
                    _target.transform.DOLocalPath(waypoints, duration.Value, pathTypeSelected, pathModeSelected, resolution.Value, gizmoColor.Value).SetAs(setFinal);
                }

                break;
            }

            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #12
0
 void Start()
 {
     if (meshRender == null)
     {
         meshRender = GetComponentInChildren <MeshRenderer>();
     }
     matBlock   = new MaterialPropertyBlock();
     tweenState = DOTween.To(() => stateIns, x => stateIns = x, 1, 2.0f).SetAutoKill(false).SetEase(EaseFactory.StopMotion(5, Ease.OutFlash)).Pause();
 }
コード例 #13
0
        public override void OnEnter()
        {
            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetRecyclable(setRecycle.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenEaseVector2]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(this.Owner);
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;


            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }

            switch (constraint)
            {
            case Constraint.None:
                axisSetup = AxisConstraint.None;
                break;

            case Constraint.AxisConstraintX:
                axisSetup = AxisConstraint.X;
                break;

            case Constraint.AxisConstraintY:
                axisSetup = AxisConstraint.Y;
                break;
            }


            // Easy part fromValue edit for other DotTween actions --->

            DOTween.To(() => fromValue.Value, x => resultValue.Value = x, toValue.Value, duration.Value).SetOptions(axisSetup, snapping.Value).SetAs(setFinal);

            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #14
0
        public override void OnEnter()
        {
            var _target = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_target != null)
            {
                Vector3 Vector3setup = to.IsNone ? new Vector3(x.Value, y.Value, z.Value) : to.Value;

                if (!x.IsNone)
                {
                    Vector3setup.x = x.Value;
                }
                if (!y.IsNone)
                {
                    Vector3setup.y = y.Value;
                }
                if (!z.IsNone)
                {
                    Vector3setup.z = z.Value;
                }


                to.Value = Vector3setup;
            }


            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }

            if (lookat.Value != null)
            {
                var go = lookat.Value;
                to.Value = go.transform.position;
            }

            if (UpDirection.IsNone == true)
            {
                UpDirection.Value = new Vector3(0, 1, 0);
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenRotateLookAtTransformTo]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(Fsm.GetOwnerDefaultTarget(gameObject));
            }


            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;

            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }


            switch (axisConstraintSelect)
            {
            case AxisConstraintSelect.None:
                axisData = AxisConstraint.None;
                break;

            case AxisConstraintSelect.X:
                axisData = AxisConstraint.X;
                break;

            case AxisConstraintSelect.Y:
                axisData = AxisConstraint.Y;
                break;

            case AxisConstraintSelect.Z:
                axisData = AxisConstraint.Z;
                break;

            case AxisConstraintSelect.W:
                axisData = AxisConstraint.W;
                break;
            }



            // Easy part to edit for other DotTween actions --->



            _target.transform.DOLookAt(to.Value, duration.Value, axisData, UpDirection.Value).SetAs(setFinal);


            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #15
0
        public override void OnEnter()
        {
            if (duration.Value == 0)
            {
                Debug.LogWarning("<b>[DotweenShakeTransformTo]</b><color=#E9E581ff>!!! Duration cannot be 0 !!! </color>", this.Owner);
                Finish();
            }

            var _target = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_target != null)
            {
                Vector3 Vector3setup = to.IsNone ? new Vector3(x.Value, y.Value, z.Value) : to.Value;

                if (!x.IsNone)
                {
                    Vector3setup.x = x.Value;
                }
                if (!y.IsNone)
                {
                    Vector3setup.y = y.Value;
                }
                if (!z.IsNone)
                {
                    Vector3setup.z = z.Value;
                }

                to.Value = Vector3setup;
            }

            if (elasticity.Value > 180f)
            {
                elasticity.Value = 180f;
            }
            if (elasticity.Value < 0f)
            {
                elasticity.Value = 0f;
            }

            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }

            if (toObject.Value != null)
            {
                var go = toObject.Value;
                to.Value = go.transform.position;
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenShakeTransformTo]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(Fsm.GetOwnerDefaultTarget(gameObject));
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;


            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }


            // Easy part to edit for other DotTween actions --->

            switch (dotweenTypeSelect)
            {
            case doTweenType.DoShakePosition:
                if (shakeBy.IsNone)
                {
                    _target.transform.DOShakePosition(duration.Value, to.Value, vibrato.Value, elasticity.Value, snapping.Value, fadeOut.Value).SetAs(setFinal);
                }
                else
                {
                    _target.transform.DOShakePosition(duration.Value, shakeBy.Value, vibrato.Value, elasticity.Value, snapping.Value, fadeOut.Value).SetAs(setFinal);
                }
                break;

            case doTweenType.DoShakeRotation:
                if (shakeBy.IsNone)
                {
                    _target.transform.DOShakeRotation(duration.Value, to.Value, vibrato.Value, elasticity.Value, fadeOut.Value).SetAs(setFinal);
                }
                else
                {
                    _target.transform.DOShakeRotation(duration.Value, shakeBy.Value, vibrato.Value, elasticity.Value, fadeOut.Value).SetAs(setFinal);
                }
                break;

            case doTweenType.DoShakeScale:
                if (shakeBy.IsNone)
                {
                    _target.transform.DOShakeScale(duration.Value, to.Value, vibrato.Value, elasticity.Value, fadeOut.Value).SetAs(setFinal);
                }
                else
                {
                    _target.transform.DOShakeScale(duration.Value, shakeBy.Value, vibrato.Value, elasticity.Value, fadeOut.Value).SetAs(setFinal);
                }
                break;
            }

            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #16
0
    private void Start()
    {
        mySequence = DOTween.Sequence();
        mySequence.Append(this.transform.DOShakeRotation(duration, strength, vibrato, random).SetRelative().SetEase(EaseFactory.StopMotion(8, Ease.Linear)).SetDelay(delay))
        .Append(this.transform.DOShakeRotation(duration, strength, vibrato, random).SetEase(EaseFactory.StopMotion(8, Ease.Linear)).SetDelay(delay))
        .SetDelay(delay);;

        mySequence.SetLoops(-1, LoopType.Restart);
    }
コード例 #17
0
        public override void OnEnter()
        {
            if (loopDontFinish.Value == true)
            {
                settingLoops = -1;
            }
            else
            {
                settingLoops = loopsQuantity.Value;
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetRecyclable(setRecycle.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);

            if (scrambleTypeSelect != scrambleType.None && scrambleChars.Value.Length > 0 && scrambleChars.Value.Length < 10)
            {
                Debug.LogWarning("<b>[DotweenEaseString]</b><color=#FF9900ff!!!  Use as many characters as possible (minimum 10) in 'Scramble Chars' because DOTween uses a fast scramble mode which gives better results with more characters. !!! </color>", this.Owner);
            }


            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenEaseString]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(this.Owner);
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;


            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }

            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }

            switch (scrambleTypeSelect)
            {
            case scrambleType.None:
                scrambleTypeSelected = ScrambleMode.None;
                break;

            case scrambleType.All:
                scrambleTypeSelected = ScrambleMode.All;
                break;

            case scrambleType.Custom:
                scrambleTypeSelected = ScrambleMode.Custom;
                break;

            case scrambleType.Lowercase:
                scrambleTypeSelected = ScrambleMode.Lowercase;
                break;

            case scrambleType.Numerals:
                scrambleTypeSelected = ScrambleMode.Numerals;
                break;

            case scrambleType.Uppercase:
                scrambleTypeSelected = ScrambleMode.Uppercase;
                break;
            }



            // Easy part fromValue edit for other DotTween actions --->

            DOTween.To(() => fromValue.Value, x => resultValue.Value = x, toValue.Value, duration.Value).SetOptions(richTextOn.Value, scrambleTypeSelected, scrambleChars.Value).SetAs(setFinal);

            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }
コード例 #18
0
        public override void OnEnter()
        {
            var _target = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_target != null)
            {
                Vector2 Vector2setup = to.IsNone ? new Vector2(x.Value, y.Value) : to.Value;

                if (!x.IsNone)
                {
                    Vector2setup.x = x.Value;
                }
                if (!y.IsNone)
                {
                    Vector2setup.y = y.Value;
                }

                to.Value = Vector2setup;
            }

            rigidBody = _target.GetComponent <Rigidbody2D>();

            if (rigidBody == null)
            {
                Debug.LogWarning("<b>[DotweenJumpRigidbody2dTo]</b><color=#FF9900ff>Missing Rigidbody component</color>", this.Owner);
                return;
            }

            setFinal = new TweenParams().SetDelay(setDelay.Value).SetAutoKill(setAutoKill.Value).SetSpeedBased(isSpeedBased.Value).SetRelative(setRelative.Value).OnComplete(MyCallback);



            switch (loopTypeSelect)
            {
            case loopType.None:
                if (settingLoops > 0 || settingLoops < 0)
                {
                    Debug.LogWarning("<b>[DotweenCamera]</b><color=#FF9900ff>!!! Loop Time is set but no 'Loop Type' is selected !!! </color>", this.Owner);
                }
                break;

            case loopType.Yoyo:
                setFinal.SetLoops(settingLoops, LoopType.Yoyo);
                break;

            case loopType.Restart:
                setFinal.SetLoops(settingLoops, LoopType.Restart);
                break;

            case loopType.Incremental:
                setFinal.SetLoops(settingLoops, LoopType.Incremental);
                break;
            }



            if (!tag.IsNone)
            {
                setFinal.SetId(tag.Value);
            }
            bool _isNullOrEmpty = orInputID.IsNone || orInputID == null || string.IsNullOrEmpty(orInputID.Value);

            if (_isNullOrEmpty == false)
            {
                setFinal.SetId(orInputID.Value);
            }
            bool obj_isNullOrEmpty = gameObjectId.IsNone || gameObjectId.Value == false;

            if (obj_isNullOrEmpty == false)
            {
                setFinal.SetId(Fsm.GetOwnerDefaultTarget(gameObject));
            }



            switch (easeTypeSelect)
            {
            case setEaseType.none:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Linear);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Linear));
                }
                break;

            case setEaseType.InSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InSine));
                }
                break;

            case setEaseType.OutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InOutSine:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutSine);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutSine));
                }
                break;

            case setEaseType.InQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuad));
                }
                break;

            case setEaseType.OutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuad));
                }
                break;

            case setEaseType.InOutQuad:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuad);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuad));
                }
                break;

            case setEaseType.InCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCubic));
                }
                break;

            case setEaseType.OutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCubic));
                }
                break;

            case setEaseType.InOutCubic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCubic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCubic));
                }
                break;

            case setEaseType.InQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuart));
                }
                break;

            case setEaseType.OutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuart));
                }
                break;

            case setEaseType.InOutQuart:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuart);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuart));
                }
                break;

            case setEaseType.InQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InQuint));
                }
                break;

            case setEaseType.OutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutQuint));
                }
                break;

            case setEaseType.InOutQuint:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutQuint);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutQuint));
                }
                break;

            case setEaseType.InExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InExpo));
                }
                break;

            case setEaseType.OutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutExpo));
                }
                break;

            case setEaseType.InOutExpo:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutExpo);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutExpo));
                }
                break;

            case setEaseType.InCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InCirc));
                }
                break;

            case setEaseType.OutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutCirc));
                }
                break;

            case setEaseType.InOutCirc:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutCirc);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutCirc));
                }
                break;

            case setEaseType.InElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InElastic));
                }
                break;

            case setEaseType.OutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutElastic));
                }
                break;

            case setEaseType.InOutElastic:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutElastic);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutElastic));
                }
                break;

            case setEaseType.InBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBack));
                }
                break;

            case setEaseType.OutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBack));
                }
                break;

            case setEaseType.InOutBack:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBack);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBack));
                }
                break;

            case setEaseType.InBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InBounce));
                }
                break;

            case setEaseType.OutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutBounce));
                }
                break;

            case setEaseType.InOutBounce:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutBounce);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutBounce));
                }
                break;

            case setEaseType.Flash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.Flash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.Flash));
                }
                break;

            case setEaseType.InFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InFlash));
                }
                break;

            case setEaseType.OutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.OutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.OutFlash));
                }
                break;

            case setEaseType.InOutFlash:
                if (enableEaseFactory.Value == false)
                {
                    setFinal.SetEase(Ease.InOutFlash);
                }
                if (enableEaseFactory.Value == true)
                {
                    setFinal.SetEase(EaseFactory.StopMotion(easeFactoryFps.Value, Ease.InOutFlash));
                }
                break;



            case setEaseType.AnimationCurve:
                setFinal.SetEase(animationCurve.curve);
                break;
            }


            // Update + TimeScale

            switch (updateTypeSelect)
            {
            case updateType.Normal:
                setFinal.SetUpdate(UpdateType.Normal, isTimeIndependent.Value);
                break;

            case updateType.Fixed:
                setFinal.SetUpdate(UpdateType.Fixed, isTimeIndependent.Value);
                break;

            case updateType.Late:
                setFinal.SetUpdate(UpdateType.Late, isTimeIndependent.Value);
                break;
            }


            // Easy part to edit for other DotTween actions --->

            switch (dotweenTypeSelect)
            {
            case doTweenType.DoMove:
                rigidBody.DOMove(to.Value, duration.Value, snapping.Value).SetAs(setFinal);
                break;

            case doTweenType.DoMoveX:
                float x = to.Value.x;
                rigidBody.DOMoveX(x, duration.Value, snapping.Value).SetAs(setFinal);
                break;

            case doTweenType.DoMoveY:
                float y = to.Value.y;
                rigidBody.DOMoveY(y, duration.Value, snapping.Value).SetAs(setFinal);
                break;
            }

            // <---


            if (startEvent != null)
            {
                Fsm.Event(startEvent);
                Finish();
            }
        }