public static Task WarpAndMoveTo(this Transform trans, Vector3 start, Vector3 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { return(new Tween((Vector3 pos) => { trans.position = pos; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Coroutine WarpAndMoveTo(this Transform trans, Vector3 start, Vector3 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { return(TweenManager.instance.playTween(new Tween((Vector3 pos) => { trans.position = pos; }, start, target, length, easingChoice, unscaled, repeat, onComplete))); }
public static Task EaseFill(this Image image, float target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { float start = image.fillAmount; return(new Tween((float newFill) => { image.fillAmount = newFill; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Task FadeTo(this TextMeshProUGUI cgroup, float target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { float start = cgroup.alpha; return(new Tween((float newAlpha) => { cgroup.alpha = newAlpha; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Task RotateTo(this Transform trans, Vector3 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { Vector3 start = trans.localEulerAngles; return(new Tween((Vector3 rot) => { trans.localEulerAngles = rot; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Task jump(this ScrollRect scrollRect, Vector2 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { Vector2 start = scrollRect.normalizedPosition; return(new Tween((Vector2 newPosition) => { scrollRect.normalizedPosition = newPosition; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Coroutine jump(this ScrollRect scrollRect, Vector2 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { Vector2 start = scrollRect.normalizedPosition; return(TweenManager.instance.playTween(new Tween((Vector2 newPosition) => { scrollRect.normalizedPosition = newPosition; }, start, target, length, easingChoice, unscaled, repeat, onComplete))); }
public static Coroutine EaseFill(this Image image, float target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { float start = image.fillAmount; return(TweenManager.instance.playTween(new Tween((float newFill) => { image.fillAmount = newFill; }, start, target, length, easingChoice, unscaled, repeat, onComplete))); }
public static Coroutine FadeTo(this CanvasGroup cgroup, float target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { float start = cgroup.alpha; return(TweenManager.instance.playTween(new Tween((float newAlpha) => { cgroup.alpha = newAlpha; }, start, target, length, easingChoice, unscaled, repeat, onComplete))); }
public static Coroutine RotateTo(this Transform trans, Vector3 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { Vector3 start = trans.localEulerAngles; return(TweenManager.instance.playTween(new Tween((Vector3 rot) => { trans.localEulerAngles = rot; }, start, target, length, easingChoice, unscaled, repeat, onComplete))); }
public static Task ScaleTo(this Transform trans, Vector3 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, Action onComplete = null) { Vector3 start = trans.localScale; return(new Tween((Vector3 scale) => { trans.localScale = scale; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Task EaseLayoutMinValues(this LayoutElement layout, Vector2 target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { Vector2 start = new Vector2(layout.minWidth, layout.minHeight); return(new Tween((Vector2 newDimensions) => { layout.minWidth = newDimensions.x; layout.minHeight = newDimensions.y; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }
public static Task FadeTo(this CanvasGroup cgroup, float target, float length, EasingTypes easingChoice, bool unscaled = false, Tween.TweenRepeat repeat = Tween.TweenRepeat.Once, System.Action onComplete = null) { float start = cgroup.alpha; return(new Tween((float newAlpha) => { cgroup.alpha = newAlpha; cgroup.interactable = newAlpha > 0.5f; cgroup.blocksRaycasts = newAlpha > 0.5f; }, start, target, length, easingChoice, unscaled, repeat, onComplete).Play()); }