Loading a Scene in Unity
Loading a scene in Unity is easy:
However, if the scene you are loading is very large and you will load it via this manner, the user will not have an idea on how long it will take for the scene loading to be complete.
Instead, you can load the scene asynchronously while providing an update to the user:
As per the code above, the image’s fillAmount is set to the current progress of loading the scene and the range is between 0 and 1.
To use fill in Image, you need to change the Image Type, Fill Method to Filled.
As you can see from the editor, you can move the Fill Amount slider to update the progress bar which is the same concept that the script will do when it tries to open a new scene.