Added black Loading Sphere

This commit is contained in:
Thorbjoern
2025-07-01 00:20:56 +02:00
parent 8ba92556d1
commit ca7d0c06f4
7 changed files with 41 additions and 14 deletions
@@ -136,14 +136,20 @@ namespace GhostSystem
{
Debug.LogWarning($"Batch insert failed: {response.ResponseMessage.StatusCode}, fallback to offline.");
await FallbackToOfflineAsync(batch);
OnUploadFinished?.Invoke();
}
if(response.ResponseMessage.IsSuccessStatusCode && sceneIdReady)
{
OnUploadFinished?.Invoke();
Debug.Log("Upload Finished");
}
}
catch (Exception ex)
{
Debug.LogWarning($"Insert failed, fallback to offline: {ex.Message}");
await FallbackToOfflineAsync(batch);
OnUploadFinished?.Invoke();
Debug.Log("Upload Finished");
}
}
@@ -190,6 +196,7 @@ namespace GhostSystem
public void Flush()
{
_flushTimer = 0f;
//FlushBatchAsync();
_ = FlushBatchAsync(); // Fire and forget
}
}
@@ -136,12 +136,12 @@ namespace GhostSystem
if (www.result == UnityWebRequest.Result.Success)
{
textbox.text += $"\n\rSupabase health: {www.downloadHandler.text}";
//textbox.text += $"\n\rSupabase health: {www.downloadHandler.text}";
Debug.Log($"✅ Supabase health: {www.downloadHandler.text}");
}
else
{
textbox.text += $"\n\rSupabase health check failed: {www.error}";
//textbox.text += $"\n\rSupabase health check failed: {www.error}";
Debug.LogError($"❌ Supabase health check failed: {www.error}");
}
}
@@ -153,7 +153,7 @@ namespace GhostSystem
if (www.result == UnityWebRequest.Result.Success)
{
textbox.text += "\n\rGoogle request succeeded.";
//textbox.text += "\n\rGoogle request succeeded.";
Debug.Log("✅ Google request succeeded.");
}
else
+14 -1
View File
@@ -2,6 +2,7 @@ using GhostSystem;
using UnityEngine;
using UnityEngine.SceneManagement;
using TMPro;
using System.Collections.Generic;
public class FlushAndLoad : MonoBehaviour
{
@@ -13,11 +14,13 @@ public class FlushAndLoad : MonoBehaviour
private void OnEnable()
{
GhostRecorderBatch.OnUploadFinished += HandleUploadFinished;
RoomManager.OnSceneIdReady += HandleSceneIdReady;
}
private void OnDisable()
{
GhostRecorderBatch.OnUploadFinished -= HandleUploadFinished;
RoomManager.OnSceneIdReady -= HandleSceneIdReady;
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
@@ -31,17 +34,27 @@ public class FlushAndLoad : MonoBehaviour
{
if (OVRInput.GetDown(OVRInput.Button.SecondaryIndexTrigger))
{
output.text = "Flush...\n\r" + output.text;
output.text = "Flush...";
loadingScreen.SetActive(true);
canvas.SetActive(false);
recorder.Flush();
GetComponent<SceneLoader>().NewRoom();
}
}
private void HandleUploadFinished()
{
loadingScreen.SetActive(false);
output.text = "";
}
private void HandleSceneIdReady(string id, List<GameObject> doors)
{
if (id == "Room1")
{
loadingScreen.SetActive(false);
}
}
}