Hi,
I want to a loading animation or progress bar animation using Application.LoadLevelAsync when i have load some scene.
Which one better application.laodlevel or application.loadlevelasync
I am using Unity Pro version.
Please help me by some simple example or sample code.
Hi, it’s recommended that you making the loading animation a single scene, which automatically plays animation and when it finished , it will load next scene.
The structure is : scene1 → loading scene → scene 2.
Here is a simple example of loading scene:
// First you should click “File” → “Build settings”, and organize your scene ordering.
// Then code likes this
private void ChangeScene() {
Application.LoadLevel("name of next scene");
}
// write the Application.LoadLevel(“”) method where you need.
So, here is the solution :
public class Scene1Script:MonoBehavior {
// after sth.
Application.LoadScene("Loading Scene name");
}
public class LoadingSceneScript :MonoBehavior {
// ...
Application.LoadScene("Scene2 name");
}