Sprite Movement working with AI movement (#33494)
* FINALLY * Update animals.yml
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
|
||||
namespace Content.Shared.Movement.Systems;
|
||||
|
||||
public abstract class SharedSpriteMovementSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SpriteMovementComponent, SpriteMoveEvent>(OnSpriteMoveInput);
|
||||
}
|
||||
|
||||
private void OnSpriteMoveInput(Entity<SpriteMovementComponent> ent, ref SpriteMoveEvent args)
|
||||
{
|
||||
if (ent.Comp.IsMoving == args.IsMoving)
|
||||
return;
|
||||
|
||||
ent.Comp.IsMoving = args.IsMoving;
|
||||
Dirty(ent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user