private void updateSliderSpeed() { if (values["velocityCurrent"] < 1f) { sliderSpeed.value = 0f; sliderSpeedText.text = ""; } else { if (values["velocityMaxCurrent"] > 1f) { sliderSpeed.value = values["velocityCurrent"] / values["velocityMaxCurrent"]; sliderSpeedText.text = ship.getCurrentVelocityInMetersStr() + " | " + ship.getMaxCurrentVelocityInMetersStr(); } else { sliderSpeed.value = values["velocityCurrent"] / values["velocityMax"]; sliderSpeedText.text = ship.getCurrentVelocityInMetersStr() + " | " + ship.getMaxVelocityInMetersStr(); } } }
public void refreshNumbers() { distance.text = "Distance: " + ObjectInSpace.distanceStr(owner.distanceInMeters(target)) + ", Velocity: " + target.getCurrentVelocityInMetersStr(); if (target.getMaxShield() > 0f) { sliderShield.value = target.getCurrentShield() / target.getMaxShield(); sliderShieldText.text = "Shield: " + Mathf.Floor(target.getCurrentShield()) + "/" + target.getMaxShield(); if (target.getShieldBalance() > 0) { sliderShieldText.text += " (<color=#008000ff>+" + target.getShieldBalance() + "</color>)"; } } else { sliderShield.value = 0f; sliderShieldText.text = ""; } if (target.getMaxArmor() > 0f) { sliderArmor.value = target.getCurrentArmor() / target.getMaxArmor(); sliderArmorText.text = "Armor: " + Mathf.Floor(target.getCurrentArmor()) + "/" + target.getMaxArmor(); if (target.getArmorBalance() > 0) { sliderArmorText.text += " (<color=#008000ff>+" + target.getArmorBalance() + "</color>)"; } } else { sliderArmor.value = 0f; sliderArmorText.text = ""; } if (target.getMaxHull() > 0f) { sliderHull.value = target.getCurrentHull() / target.getMaxHull(); sliderHullText.text = "Hull: " + Mathf.Floor(target.getCurrentHull()) + "/" + target.getMaxHull(); if (target.getHullBalance() > 0) { sliderHullText.text += " (<color=#008000ff>+" + target.getHullBalance() + "</color>)"; } } else { sliderHull.value = 0f; sliderHullText.text = ""; } }