mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
27 lines
814 B
C#
27 lines
814 B
C#
using Robust.Shared.IoC;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Robust.Shared.GameObjects
|
|
{
|
|
[RegisterComponent]
|
|
public class IgnorePauseComponent : Component
|
|
{
|
|
public override string Name => "IgnorePause";
|
|
|
|
protected override void OnAdd()
|
|
{
|
|
base.OnAdd();
|
|
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityPaused = false;
|
|
}
|
|
|
|
protected override void OnRemove()
|
|
{
|
|
base.OnRemove();
|
|
if (IoCManager.Resolve<IPauseManager>().IsMapPaused(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).MapID))
|
|
{
|
|
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityPaused = true;
|
|
}
|
|
}
|
|
}
|
|
}
|