changed maps but lighting fked

This commit is contained in:
ntr committed 2023-09-11 13:12:08 +10:00
1 parent e308bb2e17
commit 6959ace365
54 files changed
+75746 -8208

No files matched your search

+11 -6
View File
@@ -26,8 +26,6 @@ public class Timing: MonoBehaviour {
IEnumerator noticeLifecycle;
public string Position => $"{lapService.Position} / {lapService.Completions}";
void Awake() {
ui = GetComponent<TimingUI>();
sectorTimes = new List<SectorTime>();
@@ -49,6 +47,12 @@ public class Timing: MonoBehaviour {
}
void Update() {
// hmr
if (lapService == null) {
Awake();
Start();
}
if (timerEnabled) {
sectorTime = Time.timeAsDouble - sectorStart;
lapTime = Time.timeAsDouble - lapStart;
@@ -127,8 +131,7 @@ public class Timing: MonoBehaviour {
if (noticeLifecycle != null) StopCoroutine(noticeLifecycle);
noticeLifecycle = RecentLapLifecycle(l);
StartCoroutine(noticeLifecycle);
StartCoroutine(lapService.PostLap(l));
StartCoroutine(lapService?.PostLap(l));
}
IEnumerator RecentLapLifecycle(Lap l) {
@@ -137,8 +140,10 @@ public class Timing: MonoBehaviour {
ui.HideRecentLap();
}
public Lap LapRecord => lapService.LapRecord;
public Lap Pb => lapService.Pb;
// these can be null after HMR
public Lap LapRecord => lapService?.LapRecord;
public Lap Pb => lapService?.Pb;
public string Position => $"{lapService?.Position} / {lapService?.Completions}";
public TimingNotice CompareLap(Lap lap) {
double? lrSeconds = LapRecord != null ? LapRecord.TotalTime : null;