pu class
This commit is contained in:
1 parent
760d3fccb9
commit
a5b25de90a
5 files changed
+97
-36
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user