public void IncomingDelivery(Actor self) { if (!IsTraitDisabled) { wsb.PlayCustomAnimationRepeating(self, Info.ActiveSequence); } }
void ITick.Tick(Actor self) { if (IsTraitDisabled) { return; } if (!animPlaying && ((repairing && Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) || (rearming && Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm)))) { wsb.PlayCustomAnimationRepeating(self, Info.Sequence); animPlaying = true; } else if (animPlaying && (!repairing || !Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) && (!rearming || !Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm))) { wsb.CancelCustomAnimation(self); animPlaying = false; } // If an actor died before finishing resupply, there will never be a ResupplyTick call // with ResupplyType.None (as activities tick before ITick), so reset here every tick // to prevent the animation from continuing after the resupplied actor died. repairing = false; rearming = false; }
void UpdateAnimation(Actor self, MovementType types) { var playAnim = false; if (!IsTraitDisabled && (types & Info.ValidMovementTypes) != 0) playAnim = true; if (!playAnim && wsb.DefaultAnimation.CurrentSequence.Name == Info.MoveSequence) { wsb.CancelCustomAnimation(self); return; } if (playAnim && wsb.DefaultAnimation.CurrentSequence.Name != Info.MoveSequence) wsb.PlayCustomAnimationRepeating(self, Info.MoveSequence); }
void ITick.Tick(Actor self) { if (IsTraitDisabled) { return; } if (!animPlaying && ((repairing && Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) || (rearming && Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm)))) { wsb.PlayCustomAnimationRepeating(self, Info.Sequence); animPlaying = true; } else if (animPlaying && (!repairing || !Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) && (!rearming || !Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm))) { wsb.CancelCustomAnimation(self); animPlaying = false; } }