private static void Postfix(GameObject ___owner) { LivingCrystal livingCrystal = ___owner.GetComponent <LivingCrystal>(); if (livingCrystal == null) { return; } ___owner.GetComponent <PrimaryElement>().Temperature = temperature; }
private static void Prefix(GasAndLiquidConsumerMonitor.Instance __instance, Sim.MassConsumedCallback mcd) { LivingCrystal livingCrystal = __instance.GetComponent <LivingCrystal>(); if (livingCrystal == null) { return; } if (mcd.mass > 0.0f) { livingCrystal.AccumulateMass(mcd.mass, mcd.temperature); } }
private static void Prefix(GameObject ___owner) { temperature = ___owner.GetComponent <PrimaryElement>().Temperature; LivingCrystal livingCrystal = ___owner.GetComponent <LivingCrystal>(); if (livingCrystal == null) { return; } if (livingCrystal.CanConsumeTemperature()) { float decreasedTemperature = Math.Max(livingCrystal.ConsumeTemperature() + LivingCrystalConfig.OutputTemperatureDelta, LivingCrystalConfig.LethalLowTemperature); ___owner.GetComponent <PrimaryElement>().Temperature = decreasedTemperature; } }