menu
This commit is contained in:
1 parent
45fc3026b4
commit
7dc0a04856
15 files changed
+339
-125
No files matched your search
@@ -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";
|
||||
|
||||
|
||||
Reference in new issue
Block a user