-
Notifications
You must be signed in to change notification settings - Fork 2k
Remove unneed code & Synchronize native and wasm's logic #18752
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
base: v3.8.7
Are you sure you want to change the base?
Conversation
@@ -975,7 +975,6 @@ export class Skeleton extends UIRenderer { | |||
this._animationName = name; | |||
trackEntry = this._instance!.setAnimation(trackIndex, name, loop); | |||
} | |||
this._markForUpdateRenderData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic does not exist at jsb-spine-skeleton.js(native platform). So remove it to synchronize with native.
@@ -190,7 +190,6 @@ TrackEntry *SkeletonAnimation::setAnimation(int trackIndex, const std::string &n | |||
return nullptr; | |||
} | |||
auto *trackEntry = _state->setAnimation(trackIndex, animation, loop); | |||
_state->apply(*_skeleton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spine's official code doesn`t contain apply logic.
Official code
@@ -241,7 +240,6 @@ TrackEntry *SkeletonAnimation::getCurrent(int trackIndex) { | |||
void SkeletonAnimation::clearTracks() { | |||
if (_state) { | |||
_state->clearTracks(); | |||
super::setToSetupPose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spine's official code doesn`t contain apply logic.
Official code
@@ -175,17 +175,9 @@ TrackEntry *SpineSkeletonInstance::setAnimation(float trackIndex, const spine::S | |||
if (!_skeleton) return nullptr; | |||
spine::Animation *animation = _skeleton->getData()->findAnimation(name); | |||
if (!animation) { | |||
_animState->clearTracks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synchronize with native's logic
return nullptr; | ||
} | ||
auto *trackEntry = _animState->setAnimation(trackIndex, animation, loop); | ||
_animState->apply(*_skeleton); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synchronize with native's logic
@cocos-robot run test cases |
@bofeng-song, Please check the result of
Task Details
|
@bofeng-song, Please check the result of
Task Details |
Re: #
#18596
#18580
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: