Beam Component and Lightning Component (#10196)
This commit is contained in:
31
Content.Client/Beam/BeamSystem.cs
Normal file
31
Content.Client/Beam/BeamSystem.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Content.Client.Beam.Components;
|
||||
using Content.Shared.Beam;
|
||||
using Content.Shared.Beam.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Beam;
|
||||
|
||||
public sealed class BeamSystem : SharedBeamSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeNetworkEvent<BeamVisualizerEvent>(BeamVisualizerMessage);
|
||||
}
|
||||
|
||||
//TODO: Sometime in the future this needs to be replaced with tiled sprites
|
||||
private void BeamVisualizerMessage(BeamVisualizerEvent args)
|
||||
{
|
||||
if (TryComp<SpriteComponent>(args.Beam, out var sprites))
|
||||
{
|
||||
sprites.Rotation = args.UserAngle;
|
||||
|
||||
if (args.BodyState != null)
|
||||
{
|
||||
sprites.LayerSetState(0, args.BodyState);
|
||||
sprites.LayerSetShader(0, args.Shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user