Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Tween from the middle? #9

Open
KazukiKuriyama opened this issue Sep 29, 2023 · 4 comments
Open

How to Tween from the middle? #9

KazukiKuriyama opened this issue Sep 29, 2023 · 4 comments

Comments

@KazukiKuriyama
Copy link

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
        );
@AnnulusGames
Copy link
Owner

AnnulusGames commented Sep 30, 2023

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
);

@KazukiKuriyama
Copy link
Author

すみません、説明が不足していました。
Tweenの定義部分の変更をを行わずにDOTweenでいうところのtween.Gotoのスキップ機能を使いたいです。

@AnnulusGames
Copy link
Owner

現バージョンではGotoに相当する機能は存在しません。
今後のバージョンで追加を予定しています。

@AnnulusGames
Copy link
Owner

いくつかの実装を検討した結果、この機能の追加はMagic Tweenの設計上難しいことが判明しました。
引き続き検討を続けていきますが、将来的にGotoがサポートされない可能性があります。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants