1
0

RotatingLightSystem.cs 631 B

123456789101112131415161718192021222324
  1. using Content.Shared.Light;
  2. using Content.Shared.Light.Components;
  3. using Robust.Shared.GameObjects;
  4. namespace Content.Server.Light.EntitySystems;
  5. public sealed class RotatingLightSystem : SharedRotatingLightSystem
  6. {
  7. public override void Initialize()
  8. {
  9. base.Initialize();
  10. SubscribeLocalEvent<RotatingLightComponent, PointLightToggleEvent>(OnLightToggle);
  11. }
  12. private void OnLightToggle(EntityUid uid, RotatingLightComponent comp, PointLightToggleEvent args)
  13. {
  14. if (comp.Enabled == args.Enabled)
  15. return;
  16. comp.Enabled = args.Enabled;
  17. Dirty(uid, comp);
  18. }
  19. }