Re-organize all projects (#4166)
This commit is contained in:
28
Content.Client/Markers/MarkerComponent.cs
Normal file
28
Content.Client/Markers/MarkerComponent.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Markers
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class MarkerComponent : Component
|
||||
{
|
||||
public override string Name => "Marker";
|
||||
|
||||
protected override void Startup()
|
||||
{
|
||||
base.Startup();
|
||||
|
||||
UpdateVisibility();
|
||||
}
|
||||
|
||||
public void UpdateVisibility()
|
||||
{
|
||||
var system = EntitySystem.Get<MarkerSystem>();
|
||||
|
||||
if (Owner.TryGetComponent(out ISpriteComponent? sprite))
|
||||
{
|
||||
sprite.Visible = system.MarkersVisible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user