Example #1
0
 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>();
 }
Example #3
0
 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);
         }
     }
 }
Example #4
0
 private void Awake()
 {
     Powered = gameObject.GetComponent <IAPCPowered>();
 }