Added Passthrough for loading screen and base scene

This commit is contained in:
Thorbjoern
2025-07-03 23:32:55 +02:00
parent c15ce3a318
commit 55a1f106dd
2 changed files with 253 additions and 11 deletions
+25 -5
View File
@@ -4,6 +4,8 @@ using UnityEngine.SceneManagement;
using TMPro;
using System.Collections.Generic;
using UnityEngine.UI;
using Cysharp.Threading.Tasks;
using System.Threading.Tasks;
public class FlushAndLoad : MonoBehaviour
{
@@ -12,6 +14,7 @@ public class FlushAndLoad : MonoBehaviour
public GhostRecorderBatch recorder;
public GameObject loadingScreen;
public GameObject canvas;
public GameObject passthroughLayer;
private string sceneId;
@@ -42,11 +45,12 @@ public class FlushAndLoad : MonoBehaviour
else
{
output.text = "Flush...";
loadingScreen.SetActive(true);
_ = LoadScene();
/*loadingScreen.SetActive(true);
canvas.SetActive(false);
recorder.Flush();
GetComponent<SceneLoader>().NewRoom();
GetComponent<SceneLoader>().NewRoom();*/
}
}
@@ -56,8 +60,10 @@ public class FlushAndLoad : MonoBehaviour
{
loadingScreen.SetActive(false);
output.text = "";
if (sceneId == "End")
{
output.text = "Durchlauf beendet.";
}
}
private void HandleSceneIdReady(string id, List<GameObject> doors)
@@ -66,12 +72,26 @@ public class FlushAndLoad : MonoBehaviour
if (id == "Room1")
{
loadingScreen.SetActive(false);
passthroughLayer.SetActive(false);
}
if (id == "End")
{
output.text = "Durchlauf beendet.";
instruction.text = "Drücke den rechten Trigger, um die Anwendung zu beenden.";
canvas.SetActive(true);
passthroughLayer.SetActive(true);
}
}
private async UniTask Loadingscreen()
{
loadingScreen.SetActive(true);
canvas.SetActive(false);
}
private async UniTaskVoid LoadScene()
{
await Loadingscreen();
recorder.Flush();
GetComponent<SceneLoader>().NewRoom();
}
}