cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

[Tween System] Unlimited time update api

Open smallmain opened this issue 8 months ago • 0 comments

Cocos Creator version

3.8.2

System information

MacOS

Issue description

Right now we have a finite time 'update' api. good job!

As discussed in the previous issue, this api gives users more freedom and is the basis for some speed-driven animations, hopefully soon.

tween()
    .update(
        (target: T, dt: number, ...args: R) => {
            const [speed] = args;
            target.string = String(Number(target.string) + speed);

            if (target.string === "100") {
                return false;
            }
        },
        ...args,
    )
    .start();

Details: https://github.com/cocos/cocos-engine/issues/17076

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response

smallmain avatar Jun 24 '24 01:06 smallmain