mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
29 lines
801 B
C#
29 lines
801 B
C#
using Robust.Shared.IoC;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Robust.Shared.GameObjects
|
|
{
|
|
[RegisterComponent]
|
|
public class IgnorePauseComponent : Component
|
|
{
|
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
|
|
|
public override string Name => "IgnorePause";
|
|
|
|
protected override void OnAdd()
|
|
{
|
|
base.OnAdd();
|
|
_entMan.GetComponent<MetaDataComponent>(Owner).EntityPaused = false;
|
|
}
|
|
|
|
protected override void OnRemove()
|
|
{
|
|
base.OnRemove();
|
|
if (IoCManager.Resolve<IPauseManager>().IsMapPaused(_entMan.GetComponent<TransformComponent>(Owner).MapID))
|
|
{
|
|
_entMan.GetComponent<MetaDataComponent>(Owner).EntityPaused = true;
|
|
}
|
|
}
|
|
}
|
|
}
|