mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 01:57:07 +02:00
* Engine changes for more server-pushed lighting variables, but apparently this is a deprecated way of doing things anyway * Removed two unecessary uses of virtual
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using Robust.Shared.GameStates;
|
|
|
|
namespace Robust.Shared.GameObjects
|
|
{
|
|
public abstract class SharedPointLightSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<SharedPointLightComponent, ComponentGetState>(GetCompState);
|
|
SubscribeLocalEvent<SharedPointLightComponent, ComponentHandleState>(HandleCompState);
|
|
}
|
|
|
|
private void GetCompState(EntityUid uid, SharedPointLightComponent component, ref ComponentGetState args)
|
|
{
|
|
args.State = new PointLightComponentState(component.Enabled, component.Color, component.Radius, component.Offset, component.Energy, component.Softness);
|
|
}
|
|
|
|
private void HandleCompState(EntityUid uid, SharedPointLightComponent component, ref ComponentHandleState args)
|
|
{
|
|
if (args.Current is not PointLightComponentState newState) return;
|
|
component.Enabled = newState.Enabled;
|
|
component.Radius = newState.Radius;
|
|
component.Offset = newState.Offset;
|
|
component.Color = newState.Color;
|
|
component.Energy = newState.Energy;
|
|
component.Softness = newState.Softness;
|
|
}
|
|
}
|
|
}
|