This commit is contained in:
ntr committed 2023-08-09 17:23:19 +10:00
1 parent b65814e4af
commit d291dc5a06
5 files changed
+97 -36

No files matched your search

+16 -1
View File
@@ -12,6 +12,10 @@ public class ControlsUI : MonoBehaviour {
UIDocument uiDocument;
Label speed;
Label shields;
Label puAccel;
Label puDecel;
Label puStrafe;
Label puShield;
void OnEnable() {
Init();
@@ -21,6 +25,12 @@ public class ControlsUI : MonoBehaviour {
uiDocument = GetComponent<UIDocument>();
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");
}
void FixedUpdate() {
@@ -31,6 +41,11 @@ public class ControlsUI : MonoBehaviour {
}
speed.text = $"{ship.Speed():0}";
shields.text = ship.Shields;
shields.text = ship.powerUnit.ShieldsPct;
puAccel.text = ship.powerUnit.Acceleration.ToString();
puDecel.text = ship.powerUnit.Deceleration.ToString();
puStrafe.text = ship.powerUnit.Strafing.ToString();
puShield.text = ship.powerUnit.ShieldsMax.ToString();
}
}