Added Passthrough for loading screen and base scene
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user