Beispiel #1
0
 public override void TurnOffSupply()
 {
     if (InternalResistance > 0)
     {
         foreach (PowerTypeCategory Connecting in ControllingNode.CanConnectTo)
         {
             ControllingNode.RestoreResistance(Connecting);
         }
     }
     ElectricalSynchronisation.NUResistanceChange.Add(ControllingNode);
     PowerSupplyFunction.TurnOffSupply(this);
 }
Beispiel #2
0
    public override void TurnOffSupply()
    {
        if (InternalResistance > 0)
        {
            foreach (PowerTypeCategory Connecting in ControllingNode.CanConnectTo)
            {
                ControllingNode.RestoreResistance(Connecting);
            }
        }

        if (ElectricalManager.Instance?.electricalSync?.NUResistanceChange != null)
        {
            ElectricalManager.Instance.electricalSync.NUResistanceChange.Add(ControllingNode);
        }

        PowerSupplyFunction.TurnOffSupply(this);
    }
        public override void TurnOffSupply()
        {
            if (InternalResistance > 0)
            {
                foreach (PowerTypeCategory Connecting in ControllingNode.CanConnectTo)
                {
                    ControllingNode.RestoreResistance(Connecting);
                }
            }

            // On some transitional scenes like the DontDestroyOnLoad scene, we don't have an ElectricalManager.
            // We should not try to update it in those cases.
            if (ElectricalManager.Instance?.electricalSync?.NUResistanceChange != null)
            {
                ElectricalManager.Instance.electricalSync.NUResistanceChange.Add(ControllingNode);
                PowerSupplyFunction.TurnOffSupply(this);
            }
        }