Made It Work
Various improvements in scripts and working with the old loding mechanism
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using GhostSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TMPro;
|
||||
|
||||
public class FlushAndLoad : MonoBehaviour
|
||||
{
|
||||
public TMP_Text output;
|
||||
public GhostRecorderBatch recorder;
|
||||
public GameObject loadingScreen;
|
||||
public GameObject canvas;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
GhostRecorderBatch.OnUploadFinished += HandleUploadFinished;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
GhostRecorderBatch.OnUploadFinished -= HandleUploadFinished;
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (OVRInput.GetDown(OVRInput.Button.SecondaryIndexTrigger))
|
||||
{
|
||||
output.text = "Flush...\n\r" + output.text;
|
||||
loadingScreen.SetActive(true);
|
||||
canvas.SetActive(false);
|
||||
|
||||
recorder.Flush();
|
||||
GetComponent<SceneLoader>().NewRoom();
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleUploadFinished()
|
||||
{
|
||||
loadingScreen.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user