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

fixed #18000: [v3.8.5][bug] Nested tween with different target in parallel action could not work correctly. #18001

Merged

Conversation

dumganhar
Copy link
Contributor

Re: #18000

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

…n parallel action could not work correctly.
@dumganhar dumganhar requested a review from minggo December 4, 2024 05:55
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

Copy link

github-actions bot commented Dec 4, 2024

👍 Package size ⤵ -232 bytes, old: 5441161, new: 5440929

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -71041,46 +71041,11 @@
              */
             protected originalTarget: unknown;
             protected target: unknown;
             /**
-             * The `workerTarget` was added from Cocos Creator 3.8.4 and it's used for nest `Tween` functionality.
-             * It stores the target of sub-tween and its value may be different from `target`.
-             *
-             * Example 1:
-             * ```ts
-             *   tween(node).to(1, { scale: new Vec3(2, 2, 2) }).start();
-             *   // target and original target are both `node`, workerTarget is `null`.
-             * ```
-             *
-             * Example 2:
-             * ```ts
-             *   tween(node).parallel(                                        // ----- Root tween
-             *       tween(node).to(1, { scale: new Vec3(2, 2, 2) }),         // ----- Sub tween 1
-             *       tween(node).to(1, { position: new Vec3(10, 10, 10) })    // ----- Sub Tween 2
-             *   ).start();
-             *   // Note that only root tween is started here. We call tweens in `parallel`/`sequence` sub tweens.
-             *   // The `target` and `originalTarget` of all internal actions are `node`.
-             *   // Actions in root tween: workerTarget = null
-             *   // Actions in sub tween 1: workerTarget = node
-             *   // Actions in sub tween 2: workerTarget = node
-             * ```
-             *
-             * Example 3:
-             * ```ts
-             *   tween(node).parallel(                                        // ----- Root tween
-             *       tween(node).to(1, { scale: new Vec3(2, 2, 2) }),         // ----- Sub tween 1
-             *       tween(node.getComponent(UITransform)).to(1, {            // ----- Sub Tween 2
-             *           contentSize: new Size(10, 10)
-             *       })
-             *   ).start();
-             *   // Note that only root tween is started here. We call tweens in `parallel`/`sequence` sub tweens.
-             *   // The `target` and `originalTarget` of all internal actions are `node`.
-             *   // Actions in root tween: workerTarget = null
-             *   // Actions in sub tween 1: workerTarget = node
-             *   // Actions in sub tween 2: workerTarget = node's UITransform component
-             * ```
+             * The tween who owns this action.
              */
-            workerTarget: unknown;
+            _owner: Tween | null;
             protected tag: _cocos_tween_actions_action__ActionEnum;
             /**
              * @en The identifier that to mark an internal action.
              */
@@ -71129,8 +71094,46 @@
              */
             getOriginalTarget<T>(): T | null;
             setOriginalTarget<T>(originalTarget: T): void;
             /**
+             * Return the worker target of the current action applys on.
+             *
+             * Example 1:
+             * ```ts
+             *   tween(node).to(1, { scale: new Vec3(2, 2, 2) }).start();
+             *   // target and original target are both `node`, _getWorkerTarget returns `null`.
+             * ```
+             *
+             * Example 2:
+             * ```ts
+             *   tween(node).parallel(                                        // ----- Root tween
+             *       tween(node).to(1, { scale: new Vec3(2, 2, 2) }),         // ----- Sub tween 1
+             *       tween(node).to(1, { position: new Vec3(10, 10, 10) })    // ----- Sub Tween 2
+             *   ).start();
+             *   // Note that only root tween is started here. We call tweens in `parallel`/`sequence` sub tweens.
+             *   // The `target` and `originalTarget` of all internal actions are `node`.
+             *   // Actions in root tween: _getWorkerTarget returns `node`,
+             *   // Actions in sub tween 1: _getWorkerTarget returns `node`,
+             *   // Actions in sub tween 2: _getWorkerTarget returns `node`.
+             * ```
+             *
+             * Example 3:
+             * ```ts
+             *   tween(node).parallel(                                        // ----- Root tween
+             *       tween(node).to(1, { scale: new Vec3(2, 2, 2) }),         // ----- Sub tween 1
+             *       tween(node.getComponent(UITransform)).to(1, {            // ----- Sub Tween 2
+             *           contentSize: new Size(10, 10)
+             *       })
+             *   ).start();
+             *   // Note that only root tween is started here. We call tweens in `parallel`/`sequence` sub tweens.
+             *   // The `target` and `originalTarget` of all internal actions are `node`.
+             *   // Actions in root tween: workerTarget = `node`,
+             *   // Actions in sub tween 1: workerTarget = `node`,
+             *   // Actions in sub tween 2: workerTarget = `node`'s UITransform component.
+             * ```
+             */
+            protected _getWorkerTarget<T>(): T | null;
+            /**
              * @en get tag number.
              * @zh 获取用于识别动作的标签。
              * @method getTag
              * @return {Number}

Copy link

github-actions bot commented Dec 4, 2024

@dumganhar, Please check the result of run test cases:

Task Details

Copy link

github-actions bot commented Dec 4, 2024

@dumganhar, Please check the result of run test cases:

Task Details

@dumganhar dumganhar marked this pull request as draft December 4, 2024 10:26
@dumganhar dumganhar marked this pull request as ready for review December 4, 2024 10:34
@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

@dumganhar dumganhar requested a review from minggo December 4, 2024 10:35
Copy link

github-actions bot commented Dec 4, 2024

@dumganhar, Please check the result of run test cases:

Task Details

Copy link

github-actions bot commented Dec 4, 2024

@dumganhar, Please check the result of run test cases:

Task Details

@minggo minggo merged commit 0ec0ec3 into cocos:v3.8.5 Dec 5, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants