namespace PlanetMeat;
[Group( "Planet Meat - Units" ), Title( "Destroy Without Tech" ), Icon( "science" )]
public sealed class DestroyWithoutTech : Component
{
[Property] public string Tech { get; set; }
protected override void OnStart()
{
base.OnStart();
if ( (Tech?.Length ?? 0) > 0 && !Research.Current.HasTech( Tech ) )
{
foreach ( var comp in Components.GetAll() )
comp.Enabled = false;
GameObject.Destroy();
}
}
}