private void UpdateScoreLabel() { if (huds_.Length >= 2) { for (int x = 0; x <= 1; x++) { VisualDisplayContent hud = huds_[x]; if (hud.main && hud.score) { hud.score.text = GetScore().ToString(CultureInfo.GetCultureInfo("en-GB") ?? CultureInfo.InvariantCulture); } } } }
private void UpdateHeatIndicators() { ConfigurationLogic config = Mod.Instance.Config; try { float heat = Mathf.Clamp(Vehicle.HeatLevel, 0, 1); if (huds_.Length >= 2) { for (int x = 0; x <= 1; x++) { VisualDisplayContent instance = huds_[x]; if (!instance.main) { continue; } instance.heatHigh.fillAmount = heat; instance.heatLow.fillAmount = heat; float blink = 0; if (heat > config.HeatBlinkStartAmount) { blink = (heat - config.HeatBlinkStartAmount) / (1 - config.HeatBlinkStartAmount); } blink *= (0.5f * Mathf.Sin((float)Timex.ModeTime_ * (config.HeatBlinkFrequence - ((1 - heat) * heat * config.HeatBlinkFrequenceBoost)) * 3 * Mathf.PI)) + 0.5f; instance.main.color = new Color(1, 1 - (blink * config.HeatBlinkAmount), 1 - (blink * config.HeatBlinkAmount)); float flame = 0; if (heat > config.HeatFlameAmount) { flame = (heat - config.HeatFlameAmount) / (1 - config.HeatFlameAmount); } instance.flame.color = new Color(1, 1, 1, flame); } } } catch (Exception ex) { Mod.Instance.Logger.Exception(ex); } }
private void UpdateSpeedLabel() { if (huds_.Length >= 2) { for (int x = 0; x <= 1; x++) { VisualDisplayContent hud = huds_[x]; if (hud.speed) { hud.speed.text = Mathf.RoundToInt(GetSpeedValue()).ToString(); } if (hud.speedLabel) { hud.speedLabel.text = GetSpeedUnit(); } } } }