i searched the answers and the forums but i could not find what i am looking for so here is my question:
i have a scene which contains multiple buttons that upon clicking take me to other scenes. everything works fine but the other scenes are a little heavy while they are loading. so i need a image or a progress bar while the new scene is loading. in the answers i see lots of people refering to “Application.LoadLevelAsync”, but i could not figure out how to do that. so if you please help me about where to put “Application.LoadLevelAsync” code and displaying the image or bar while loading…
Here is my code in javascript:
If you don’t have Unity Pro, you’ll have to use LoadLevel, which pauses until the level is done. It doesn’t provide a way to have a progress bar. You could, however, put a static image on the screen, such as “Loading. Please wait…” while it’s loading.
If you have Unity Pro, you’ll probably want to run LoadLevelAsync in a coroutine so you can monitor the status of the AsyncOperation returned by LoadLevelAsync. Keep looping in the coroutine until AsyncOperation.isDone is true. Inside the coroutine loop, you can set the value of the progress bar using AsyncOperation.progress. Note that progress doesn’t update very accurately when playing inside the editor, but it’s much more accurate in end-user builds.
You could Use LoadLevel, But, load each of your gameobjects by yourself, and implement a loading bar with those elements
If you know how many elements you are going to load, then you have your max value, then for every element to load, use a Load.Asset, after it gets loaded and added to the scene, the counter of the bar add 1, and to know the width of your progress bar is barCount/barMaxCount, do not know if thats the optimal, but it is how i use a loading screen in unity free