Beispiel #1
0
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);
}
Beispiel #2
0
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);	
}