public void UpdateAir(float val) { if (m_oxygenDisplay) { if (val < .95f && m_currentState == WatchState.Inventory) { m_oxygenDisplay.SetFill(val); m_oxygenDisplay.UpdateFill((int)(val * 100f)); m_oxygenDisplay.ToggleRendering(true); if (val < 0.5) { m_oxygenDisplay.SetColor(Color.Lerp(Color.red, m_normalOxygenCol, val * 1.6f)); } else { m_oxygenDisplay.SetColor(Color.cyan); } } else { m_oxygenDisplay.ToggleRendering(false); } } }
public void UpdateHealth(float health) { if (m_healthDisplay) { m_healthDisplay.UpdateFill((int)(health * 100f)); m_healthDisplay.SetColor(Color.Lerp(m_normalHealthCol, m_normalHealthCol * 1.8f, 1 - health)); } }
public void UpdateInfection(float infection) { if (m_infectionDisplay) { if (infection < 0.01f) { m_infectionDisplay.ToggleRendering(false); } else if (m_currentState == WatchState.Inventory) { m_infectionDisplay.ToggleRendering(true); m_infectionDisplay.UpdateFill((int)(infection * 100f)); m_infectionDisplay.SetFill(infection); m_infectionDisplay.SetColor(Color.Lerp(m_normalInfectionCol, m_normalInfectionCol * 1.6f, infection)); } } }