replaceAnimation method

Future<void> replaceAnimation(
  1. SimpleDirectionAnimation newAnimation, {
  2. bool doIdle = false,
})

Implementation

Future<void> replaceAnimation(
  SimpleDirectionAnimation newAnimation, {
  bool doIdle = false,
}) async {
  await newAnimation.onLoad(gameRef);
  animation = newAnimation;
  if (doIdle) {
    idle();
  }
}