Monitor Scene Change Progress?
Posted: Wed Jun 24, 2020 5:47 pm
I was wondering what the best way to monitor scene change progress would be. Here's what I was trying, but it doesn't seem to work very well.
Even for long transitions, it seems like it only over reports 90% and then 100%.
Code: Select all
public class SceneChangeCanvasController : MonoBehaviour
{
private Coroutine progressMonitoringCoroutine;
public void OnLeaveBegin()
{
progressMonitoringCoroutine = StartCoroutine(MonitorSceneChangeProgress());
}
public void OnEnterBegin()
{
StopCoroutine(progressMonitoringCoroutine);
}
private IEnumerator MonitorSceneChangeProgress()
{
while (true)
{
if (SaveSystem.currentAsyncOperation != null)
{
Debug.Log("monitoring progress: " + SaveSystem.currentAsyncOperation.progress);
}
yield return new WaitForSeconds(0.5f);
}
}
}