Skip to content

[v3.8.6] [Tween] More override in tween modules and add toString method for all actions which will be easier for debugging.#18181

Merged
minggo merged 2 commits into
cocos:v3.8.6from
dumganhar:386-tween-more-override
Jan 15, 2025
Merged

[v3.8.6] [Tween] More override in tween modules and add toString method for all actions which will be easier for debugging.#18181
minggo merged 2 commits into
cocos:v3.8.6from
dumganhar:386-tween-more-override

Conversation

@dumganhar

Copy link
Copy Markdown
Contributor

Also add some @mangle jsDoc tag for some properties.

Re: #

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.

…thod for all actions which will be easier for debugging.

Also add some `@mangle` jsDoc tag for some properties.
@dumganhar dumganhar requested a review from minggo January 13, 2025 08:31
@github-actions

github-actions Bot commented Jan 13, 2025

Copy link
Copy Markdown

⚠️ Package size ⤴ 37 bytes, old: 5245887, new: 5245924

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -70752,12 +70752,8 @@
              * ActionManager.removeAction for the details.
              */
             protected originalTarget: unknown;
             protected target: unknown;
-            /**
-             * The tween who owns this action.
-             */
-            _owner: Tween | null;
             protected tag: _cocos_tween_actions_action__ActionEnum;
             /**
              * @en The identifier that to mark an internal action.
              */
@@ -70806,46 +70802,8 @@
              */
             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}
@@ -71123,9 +71081,8 @@
             setStartTime(time: number): void;
             getElapsed(): number;
             initWithDuration(d: number): boolean;
             isDone(): boolean;
-            _cloneDecoration(action: _cocos_tween_actions_action_interval__ActionInterval): void;
             abstract clone(): _cocos_tween_actions_action_interval__ActionInterval;
             step(dt: number): void;
             startWithTarget<T>(target: T | null): void;
             abstract reverse(): _cocos_tween_actions_action_interval__ActionInterval;

@minggo

minggo commented Jan 13, 2025

Copy link
Copy Markdown
Contributor
-            /**
-             * The tween who owns this action.
-             */
-            _owner: Tween | null;

It seems break compitibility.

@dumganhar

Copy link
Copy Markdown
Contributor Author

Actions in tween are not exported to developers. and _owner property was added in v3.8.5.
So it's safe to mark it as engineInternal & mangle.

@minggo minggo merged commit 6136a4d into cocos:v3.8.6 Jan 15, 2025
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