IOS does not load the next level

I know that having a large entry-level in Unity forces the iPhone / iPad to close the application before downloading it. The solution, I thought, would be the load level, which gives for 1 or 2 frames, and then proceeds to load the next level.

functon Start() { yield; Application.LoadLevel(1); } 

For some reason this does not work. Both scenes are correctly configured in the Unity build window, and there are no errors in Xcode.

Anyone have any suggestions I can ask for?

+4
source share
1 answer

functon is not valid here.

Assuming this is a cut and paste error, make sure of the following things:

  • you have at least two scenes in the build settings
  • it works in the editor (load scene 0 into the editor and press the play button)
  • you added your script to the object in scene '0'

In addition, I suggest using scene names instead of the scene index when calling Application.LoadLevel .

For example, you might have a scene called "Preboot" and another one called "Menu." Your "Preload" scene will be the first in your build settings. Then the call will be as follows:

 Application.LoadLevel("Menu"); 

This is less error prone if you reorganize the order of the scenes in the build settings, especially after your project starts to grow.

+1
source

Source: https://habr.com/ru/post/1347905/


All Articles