public override void OnAddedToContainer() { if (MyAPIGateway.Utilities.IsDedicated) { return; } _reactor = (MyReactor)Entity; _reactor.IsWorkingChanged += Reactor_IsWorkingChanged; Reactor_IsWorkingChanged(_reactor); }
public override void OnBeforeRemovedFromContainer() { if (MyAPIGateway.Utilities.IsDedicated) { return; } _reactor.IsWorkingChanged -= Reactor_IsWorkingChanged; _reactor = null; _effect?.Stop(); if (_effect != null) { MyParticlesManager.RemoveParticleEffect(_effect); } }