Example #1
0
    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);
    }
Example #2
0
 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);
 }
Example #3
0
 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);
 }