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);
}
}
}