mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 23:02:34 +02:00
23 lines
535 B
C#
23 lines
535 B
C#
using Robust.Shared.GameObjects.Components.Transform;
|
|
|
|
namespace Robust.Shared.GameObjects.Systems
|
|
{
|
|
public class SnapGridSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<MoveEvent>(OnMoveEvent);
|
|
}
|
|
|
|
private void OnMoveEvent(MoveEvent @event)
|
|
{
|
|
if (@event.Sender.TryGetComponent(out SnapGridComponent snapGrid))
|
|
{
|
|
snapGrid.UpdatePosition();
|
|
}
|
|
}
|
|
}
|
|
}
|