@Override
public void notifyAnimationMessage(AnimationMessageType message, int stateID) {
super.notifyAnimationMessage(message, stateID);
GameState cur = getCurrentState();
AvatarAnimationEvent.EventType type = null;
String animationName = null;
if (cur instanceof IdleState && currentAnimationName != null)
{
// transition out of the current state
type = AvatarAnimationEvent.EventType.STOPPED;
animationName = currentAnimationName;
currentAnimationName = null;
}
else if (cur instanceof CycleActionState)
{
switch (message)
{
case TransitionComplete:
type = AvatarAnimationEvent.EventType.STARTED;
animationName = cur.getAnimationName();
currentAnimationName = animationName;
break;
case PlayOnceComplete:
type = AvatarAnimationEvent.EventType.STOPPED;
animationName = cur.getAnimationName();
currentAnimationName = null;
break;
}
}
else if (cur instanceof TurnState)