move timing around
This commit is contained in:
1 parent
7849f107e4
commit
b4c89f306a
7 files changed
+182
-227
No files matched your search
@@ -10,7 +10,6 @@ using UnityEditor;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Timing: MonoBehaviour {
|
||||
[SerializeField]
|
||||
TimingUI ui;
|
||||
|
||||
public List<SectorTime> sectorTimes;
|
||||
@@ -20,12 +19,12 @@ public class Timing: MonoBehaviour {
|
||||
public double sectorTime;
|
||||
public double lapTime;
|
||||
public Sector[] sectors;
|
||||
public Lap recentLap = null;
|
||||
|
||||
double sectorStart;
|
||||
double lapStart;
|
||||
|
||||
void Awake() {
|
||||
ui = GetComponent<TimingUI>();
|
||||
sectorTimes = new List<SectorTime>();
|
||||
sectorStart = 0.0;
|
||||
sectorTime = 0.0;
|
||||
@@ -37,7 +36,6 @@ public class Timing: MonoBehaviour {
|
||||
Debug.Log("Track Sector Count - " + sectors.Length);
|
||||
|
||||
LapStorageService.GetPlayerLaps(mapName);
|
||||
recentLap = null;
|
||||
}
|
||||
|
||||
void Update() {
|
||||
|
||||
@@ -6,22 +6,19 @@ using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class TimingUI : MonoBehaviour {
|
||||
UIDocument uiDocument;
|
||||
|
||||
[SerializeField]
|
||||
ShipControls ship;
|
||||
|
||||
[SerializeField]
|
||||
Timing timing;
|
||||
|
||||
Label timer;
|
||||
Label pb;
|
||||
Label recentTime;
|
||||
Label recentDiff;
|
||||
UIDocument uiDocument;
|
||||
|
||||
VisualElement recentLap;
|
||||
VisualElement currentLap;
|
||||
VisualElement sectors;
|
||||
Label timer;
|
||||
Label pb;
|
||||
Label recentTime;
|
||||
Label recentDiff;
|
||||
|
||||
void OnEnable() {
|
||||
Init();
|
||||
@@ -29,6 +26,7 @@ public class TimingUI : MonoBehaviour {
|
||||
|
||||
void Init() {
|
||||
uiDocument = GetComponent<UIDocument>();
|
||||
timing = GetComponent<Timing>();
|
||||
|
||||
recentLap = uiDocument.rootVisualElement.Q<VisualElement>("recentLap");
|
||||
currentLap = uiDocument.rootVisualElement.Q<VisualElement>("currentLap");
|
||||
|
||||
Reference in new issue
Block a user