private static int SetId(IntPtr L) { int result; try { ToLua.CheckArgsCount(L, 2); TweenParams tweenParams = (TweenParams)ToLua.CheckObject(L, 1, typeof(TweenParams)); object id = ToLua.ToVarObject(L, 2); TweenParams o = tweenParams.SetId(id); ToLua.PushObject(L, o); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }