示例#1
0
 public override void OnCleanUp()
 {
     joulesAvailable?.Dispose();
     wattageGenerated?.Dispose();
     wattageConsumed?.Dispose();
     potentialWattageConsumed?.Dispose();
     maxSafeWattage?.Dispose();
     noCircuit?.Dispose();
     noCircuit       = null;
     consumerParent  = null;
     batteryParent   = null;
     generatorParent = null;
     lastSelected    = default;
     foreach (var pair in cache)
     {
         pair.Value.Dispose();
     }
     cache.Clear();
     batteryLabels.Clear();
     consumerLabels.Clear();
     generatorLabels.Clear();
     wasValid = false;
     base.OnCleanUp();
     Instance = null;
 }
示例#2
0
 public override void OnPrefabInit()
 {
     base.OnPrefabInit();
     Instance = this;
 }