private void EnsureInit() { if (Powered != null) { return; } Powered = GetComponent <IAPCPowered>(); }
void Start() { if (Wattusage > 0) { Resistance = 240 / (Wattusage / 240); } if (RelatedAPC != null) { if (IsEnvironmentalDevice) { RelatedAPC.EnvironmentalDevices.Add(this); } else { RelatedAPC.ConnectedDevices.Add(this); } } Powered = gameObject.GetComponent <IAPCPowered>(); }
private void EnsureInit() { if (Powered != null) { return; } Powered = GetComponent <IAPCPowered>(); if (Powered == null) { return; } if (SelfPowered) { if (AdvancedControlToScript) { Powered.PowerNetworkUpdate(ExpectedRunningVoltage); } else { Powered.StateUpdate(PowerStates.On); } } }
private void Awake() { Powered = gameObject.GetComponent <IAPCPowered>(); }