MagicTween
MagicTween copied to clipboard
How to Tween from the middle?
Is there a way to start from a time in the middle of defining Tween? For example, I want to start from the 0.5 second point in the code below (currentValue==0.5f) and transition to 1 in the remaining 0.5 seconds.
float x = 0;
await Tween.To(
() => 0,
currentValue1 => x = currentValue1,
1,
1
);
There is currently no way to move halfway through Tween. However, you can use Tween.FromTo instead. For example:
float x = 0;
await Tween.FromTo(
currentValue1 => x = currentValue1,
0.5f // start value
1f, // end value
0.5f // duration
);
すみません、説明が不足していました。 Tweenの定義部分の変更をを行わずにDOTweenでいうところのtween.Gotoのスキップ機能を使いたいです。
現バージョンではGotoに相当する機能は存在しません。 今後のバージョンで追加を予定しています。
いくつかの実装を検討した結果、この機能の追加はMagic Tweenの設計上難しいことが判明しました。 引き続き検討を続けていきますが、将来的にGotoがサポートされない可能性があります。