Skip to content

Commit

Permalink
Add safety protection for non-existent Spine animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
bofeng-song committed Aug 19, 2024
1 parent 243ab7e commit 4acdb95
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ void SkeletonAnimation::setAnimationStateData(AnimationStateData *stateData) {
}

void SkeletonAnimation::setMix(const std::string &fromAnimation, const std::string &toAnimation, float duration) {
auto *fromAni = findAnimation(fromAnimation);
auto *toAni = findAnimation(toAnimation);
if (!fromAni || !toAni) return;
if (_state) {
_state->getData()->setMix(fromAnimation.c_str(), toAnimation.c_str(), duration);
}
Expand Down

0 comments on commit 4acdb95

Please sign in to comment.