-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
minggo
merged 3 commits into
cocos:v3.8.5
from
dumganhar:385-18000-tween-nest-different-target
Dec 5, 2024
Merged
fixed #18000: [v3.8.5][bug] Nested tween with different target in parallel action could not work correctly. #18001
minggo
merged 3 commits into
cocos:v3.8.5
from
dumganhar:385-18000-tween-nest-different-target
Dec 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n parallel action could not work correctly.
@cocos-robot run test cases |
minggo
approved these changes
Dec 4, 2024
👍 Package size ⤵ -232 bytes, old: 5441161, new: 5440929Interface 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}
|
@dumganhar, Please check the result of
Task Details |
@dumganhar, Please check the result of
Task Details |
@cocos-robot run test cases |
@dumganhar, Please check the result of
Task Details |
@dumganhar, Please check the result of
Task Details |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: #18000
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: