shield detail

This commit is contained in:
ntr committed 2023-08-22 17:59:29 +10:00
1 parent b184f04457
commit 2bcd14e5ac
18 files changed
+3366 -822

No files matched your search

+6 -15
View File
@@ -14,12 +14,9 @@ public class ControlsUI : MonoBehaviour {
UIDocument uiDocument;
Label speed;
Label shields;
Label puAccel;
Label puDecel;
Label puStrafe;
Label puShield;
BoostBar boostBar;
InterfaceIcon shield;
void OnEnable() {
Init();
@@ -30,11 +27,7 @@ public class ControlsUI : MonoBehaviour {
speed = uiDocument.rootVisualElement.Q<Label>("speed");
shields = uiDocument.rootVisualElement.Q<Label>("shields");
// PowerUnit
puAccel = uiDocument.rootVisualElement.Q<Label>("puAccel");
puDecel = uiDocument.rootVisualElement.Q<Label>("puDecel");
puStrafe = uiDocument.rootVisualElement.Q<Label>("puStrafe");
puShield = uiDocument.rootVisualElement.Q<Label>("puShield");
shield = uiDocument.rootVisualElement.Q<InterfaceIcon>("ShieldIcon");
boostBar = uiDocument.rootVisualElement.Q<BoostBar>("boostBar");
}
@@ -47,12 +40,10 @@ public class ControlsUI : MonoBehaviour {
}
speed.text = $"{ship.Speed():0}";
shields.text = ship.powerUnit.ShieldPct;
puAccel.text = ship.powerUnit.Acceleration.ToString();
puDecel.text = ship.powerUnit.Deceleration.ToString();
puStrafe.text = ship.powerUnit.Strafing.ToString();
puShield.text = ship.powerUnit.ShieldMax.ToString();
shield.detail = ship.powerUnit.ShieldPct switch {
"100" => "",
string pct => pct,
};
boostBar.progress = ship.powerUnit.BoostProgress;
boostBar.charges = ship.powerUnit.BoostCharges;