void Skeleton::playAnimation(const String& animName, bool once) { SkeletonAnimation *anim = getAnimation(animName); if(!anim) return; if(anim == currentAnimation && !once) return; if(currentAnimation) currentAnimation->Stop(); currentAnimation = anim; anim->Play(once); }
void Skeleton::playAnimationByIndex(int index, bool once) { if(index > animations.size()-1) return; SkeletonAnimation *anim = animations[index]; if(!anim) return; if(anim == currentAnimation && !once) return; if(currentAnimation) currentAnimation->Stop(); currentAnimation = anim; anim->Play(once); }