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; }
public override void OnPrefabInit() { base.OnPrefabInit(); Instance = this; }