From f7bdb5df1d0da173c4d5b2f314faed989fe077d7 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 4 Aug 2023 16:04:10 +1000 Subject: [PATCH] stop clearing bug --- Assets/Src/Timing.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Src/Timing.cs b/Assets/Src/Timing.cs index d804295..d59ed3c 100644 --- a/Assets/Src/Timing.cs +++ b/Assets/Src/Timing.cs @@ -23,6 +23,8 @@ public class Timing: MonoBehaviour { double sectorStart; double lapStart; + IEnumerator noticeLifecycle; + void Awake() { ui = GetComponent(); sectorTimes = new List(); @@ -114,7 +116,9 @@ public class Timing: MonoBehaviour { Debug.Log($"EndLap {l}"); // have to show this before we persist the lap in case it is the pb - StartCoroutine(RecentLapLifecycle(l)); + if (noticeLifecycle != null) StopCoroutine(noticeLifecycle); + noticeLifecycle = RecentLapLifecycle(l); + StartCoroutine(noticeLifecycle); LapStorageService.PersistLap(l); }