This commit is contained in:
ntr committed 2023-07-26 23:52:26 +10:00
1 parent 45fc3026b4
commit 7dc0a04856
15 files changed
+339 -125

No files matched your search

+7 -1
View File
@@ -20,7 +20,7 @@ public class ShipUi : MonoBehaviour {
VisualElement sectors;
VisualElement timeSheet;
void OnEnable() {
void Awake() {
speed = uiDocument.rootVisualElement.Q<Label>("speed");
timer = uiDocument.rootVisualElement.Q<Label>("timer");
sectors = uiDocument.rootVisualElement.Q<VisualElement>("sectors");
@@ -28,6 +28,12 @@ public class ShipUi : MonoBehaviour {
}
void FixedUpdate() {
if (timer == null || speed == null) {
Debug.LogWarning("no speed or timer");
Awake();
return;
}
timer.text = $"{TimeSpan.FromSeconds(timing.lapTime):m\\:ss\\.fff}";
speed.text = $"{ship.Speed():0} u/s";