public void UpdateDecomposition(float dt) { // todo: протестить при наличии нескольких трупов // скорость гниения в зависимости от температуры и окружения float rate = Mathf.InverseLerp(FOOD.DEFAULT_PRESERVE_TEMPERATURE, FOOD.DEFAULT_ROT_TEMPERATURE, temperature) + Mathf.InverseLerp(FOOD.HIGH_PRESERVE_TEMPERATURE, FOOD.HIGH_ROT_TEMPERATURE, temperature); switch (Rottable.AtmosphereQuality(gameObject)) { case Rottable.RotAtmosphereQuality.Contaminating: rate += 1; break; case Rottable.RotAtmosphereQuality.Normal: break; case Rottable.RotAtmosphereQuality.Sterilizing: rate *= 0.5f; break; } master.decomposition += (rate * dt); }
public void Render1000ms(float dt) { Rottable.SetStatusItems(GetComponent <KSelectable>(), Rottable.IsRefrigerated(base.gameObject), Rottable.AtmosphereQuality(base.gameObject)); }