Monitor Scene Change Progress?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Monitor Scene Change Progress?

Post by VoodooDetective »

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.

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);
            }
        }
    }
Even for long transitions, it seems like it only over reports 90% and then 100%.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Monitor Scene Change Progress?

Post by Tony Li »

Are you monitoring in the Unity editor or in a build? Unity does not return accurate progress in the editor.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: Monitor Scene Change Progress?

Post by VoodooDetective »

Ahhh ok, so that's probably why. Thanks for explaining that! I was working in the editor.
Post Reply