public void CrossFadeVector(TweenRunner <VectorTween> tweenRunner, float duration, Vector3 start, Vector3 end, UnityAction <Vector3> callback, UnityAction endCallback) { var vectorTween = new VectorTween { duration = duration, startValue = start, targetValue = end }; vectorTween.AddOnChangedCallback(callback); if (endCallback != null) { vectorTween.AddOnEndCallback(endCallback); } vectorTween.ignoreTimeScale = true; tweenRunner.StartTween(vectorTween); }
protected virtual async UniTask MoveAsync(Vector3 position, float duration, CancellationToken cancellationToken) { var tween = new VectorTween(ShakedTransform.position, position, duration, pos => ShakedTransform.position = pos, false, EasingType.SmoothStep, ShakedTransform); await positionTweener.RunAsync(tween, cancellationToken); }
private async Task MoveAsync(Vector3 position, float duration, CancellationToken cancellationToken) { var tween = new VectorTween(shakedTransform.position, position, duration, pos => shakedTransform.position = pos, false, EasingType.SmoothStep); await positionTweener.RunAsync(tween, cancellationToken); }