Function amethyst_animation::toggle_animation [] [src]

pub fn toggle_animation(
    controls: &mut WriteStorage<AnimationControl>,
    animation: &Handle<Animation>,
    entity: Entity,
    end: EndControl
)

Toggle the state between paused and running for the given animation on the given entity.

Parameters:

  • controls: animation control storage in the world.
  • animation: handle to the animation
  • entity: entity to run the animation on. Must either have an AnimationHierarchy that matches the Animation, or only refer to a single node, else the animation will not be run.
  • end: action to perform when the animation has reached its end.