Kind of fixed weird issue with Task not stopping on application Quit

This commit is contained in:
Thorbjoern
2025-07-22 01:15:09 +02:00
parent 440820f65a
commit 7b99f58a27
2 changed files with 20 additions and 1 deletions
+12
View File
@@ -33663,6 +33663,18 @@ MonoBehaviour:
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 294328934}
m_TargetAssemblyTypeName: GhostSystem.GhostReplayManager, Assembly-CSharp
m_MethodName: StopAwaitingFrames
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 294328934}
m_TargetAssemblyTypeName: GhostSystem.GhostReplayManager, Assembly-CSharp
m_MethodName: StopReplay
@@ -43,6 +43,7 @@ namespace GhostSystem
private float totalDuration = 0f;
private string firstTimestamp = "";
private string lastTimestamp = "";
private bool awaitingFrames;
private Dictionary<string, List<FrameModel>> objectTracks = new();
@@ -108,6 +109,7 @@ namespace GhostSystem
if (!supabaseReady || !sceneIdReady) return;
sceneId = loadedSceneId;
awaitingFrames = true;
await LoadAllFrames();
loadingScreen.SetActive(false);
@@ -193,7 +195,7 @@ namespace GhostSystem
private async UniTaskVoid PeriodicUpdateFrames() // lädt alle 10 s neue Frames nach, falls verfügbar
{
while (true)
while (awaitingFrames)
{
await UniTask.Delay(TimeSpan.FromSeconds(10));
await LoadNewFramesAfter(latestLoadedTimestamp);
@@ -347,6 +349,11 @@ namespace GhostSystem
TrackedObjects.RemoveRange(TrackedObjects.Count - doorCount, doorCount);
doorCount = 0;
}
public void StopAwaitingFrames()
{
awaitingFrames = false;
}
}
}