Clear method for animation state.

This commit is contained in:
NathanSweet 2013-04-15 18:05:53 +02:00
parent d3bd35a0e3
commit 4568d7ebfd
2 changed files with 10 additions and 0 deletions

View File

@ -59,6 +59,11 @@ namespace Spine {
Time = 0;
}
public void Clear () {
previous = null;
Animation = null;
}
override public String ToString () {
return (Animation != null && Animation.Name != null) ? Animation.Name : base.ToString();
}

View File

@ -60,6 +60,11 @@ public class AnimationState {
current.apply(skeleton, currentTime, currentLoop);
}
public void clear () {
previous = null;
current = null;
}
/** @see #setAnimation(Animation, boolean) */
public void setAnimation (String animationName, boolean loop) {
Animation animation = data.getSkeletonData().findAnimation(animationName);