loading bar scene unity
//LOADING BAR CORE
private IEnumerator LoadAsync(string sceneName)
{
AsyncOperation operation = SceneManager.LoadSceneAsync(sceneName);
//repeat until finished loading
while(!operation.isDone)
{
//get the progress value
float progress = Mathf.Clamp01(operation.progress / 0.9f);
//update loading slider
loadingSlider.value = progress;
//update loading text
loadingText.text = ((int)(progress * 100)).ToString() + "%";
//IEnumerator requires to yield something
yield return null;
}
}