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);
            }
        }
Example #2
0
 public override void TurnOffSupply()
 {
     isOnForInterface = false;
     PowerSupplyFunction.TurnOffSupply(this);
 }