Ejemplo n.º 1
0
 /**
  * Request that this state transition to another.
  *
  * @param key a key to match against a map of possible transitions.
  * @param layer the layer our state belongs to.
  * @return the new state to transition to. May be null if the transition was not possible or was
  *     ignored for some reason.
  */
 public AbstractFiniteState doTransition(final String key, final AnimationLayer layer) {
   AbstractTransitionState state = _transitions.get(key);
   if (state == null) {
     state = _transitions.get("*");
   } else {
     return state.doTransition(this, layer);
   }
   return null;
 }
Ejemplo n.º 2
0
 @Override
 public void update(final double globalTime, final AnimationLayer layer) {
   if (!getSourceTree().setTime(globalTime, layer.getManager())) {
     final StateOwner lastOwner = getLastStateOwner();
     if (_endTransition != null) {
       // time to move to end transition
       final AbstractFiniteState newState = _endTransition.doTransition(this, layer);
       if (newState != null) {
         newState.resetClips(layer.getManager());
         newState.update(globalTime, layer);
       }
       if (this != newState) {
         lastOwner.replaceState(this, newState);
       }
     }
   }
 }