Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
bofeng-song committed Nov 16, 2023
1 parent d6ae3e9 commit 1aea419
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions cocos/spine/lib/spine-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,7 @@ declare namespace spine {
isCache: boolean;
isDelete: boolean;
enable: boolean;
setTrackListener: any;
initSkeleton(data: SkeletonData);
getAnimationState();
setAnimation(trackIndex: number, name: string, loop: boolean): spine.TrackEntry | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ static void animationCallback(AnimationState *state, EventType type, TrackEntry
instance->onAnimationStateEvent(entry, type, event);
}

void trackEntryCallback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) {
(static_cast<SpineSkeletonInstance *>(state->getRendererObject()))->onTrackEntryEvent(entry, type, event);
if (type == EventType_Dispose) {
if (entry->getRendererObject()) {
entry->setRendererObject(nullptr);
static void trackEntryCallback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) {
void* renderObj = state->getRendererObject();
if (renderObj) {
(static_cast<SpineSkeletonInstance *>(renderObj))->onTrackEntryEvent(entry, type, event);
if (type == EventType_Dispose) {
if (entry->getRendererObject()) {
entry->setRendererObject(nullptr);
}
}
}
}
Expand Down

0 comments on commit 1aea419

Please sign in to comment.