private void OnPowerSupply(EntityUid uid, LitOnPoweredComponent component, PowerNetBatterySupplyEvent args) { if (EntityManager.TryGetComponent <PointLightComponent>(uid, out var light)) { light.Enabled = args.Supply; } }
private void HandlePowerSupply(EntityUid uid, AmbientOnPoweredComponent component, PowerNetBatterySupplyEvent args) { if (!EntityManager.TryGetComponent <AmbientSoundComponent>(uid, out var ambientSound)) { return; } if (ambientSound.Enabled == args.Supply) { return; } ambientSound.Enabled = args.Supply; Dirty(ambientSound); }