replacePlatformAnimation method

Future<void> replacePlatformAnimation(
  1. PlatformAnimations animation, {
  2. bool doIdle = false,
})

Implementation

Future<void> replacePlatformAnimation(
  PlatformAnimations animation, {
  bool doIdle = false,
}) {
  return super.replaceAnimation(
    SimpleDirectionAnimation(
      idleRight: animation.idleRight,
      runRight: animation.runRight,
      idleLeft: animation.idleLeft,
      runLeft: animation.runLeft,
      others: {
        if (animation.jump?.jumpUpRight != null)
          JumpAnimationsEnum.jumpUpRight.name: animation.jump!.jumpUpRight,
        if (animation.jump?.jumpUpLeft != null)
          JumpAnimationsEnum.jumpUpLeft.name: animation.jump!.jumpUpLeft!,
        if (animation.jump?.jumpDownRight != null)
          JumpAnimationsEnum.jumpDownRight.name:
              animation.jump!.jumpDownRight,
        if (animation.jump?.jumpDownLeft != null)
          JumpAnimationsEnum.jumpDownLeft.name: animation.jump!.jumpDownLeft!,
        ...animation.others ?? {},
      },
    ),
    doIdle: doIdle,
  );
}