public static GetSceneByBuildIndex ( int buildIndex ) : |
||
buildIndex | int | Build index as shown in the Build Settings window. |
Résultat |
public static Scene GetSceneByBuildIndex(int buildIndex)
{
Scene scene;
INTERNAL_CALL_GetSceneByBuildIndex(buildIndex, out scene);
return scene;
}
public static void LoadSceneById(int id, bool force = false) { if (id >= GetSceneCount()) { throw new Exception("Scene Index outisde of Range"); } int index = 1 + id; Scene scene = SCM.GetSceneByBuildIndex(index); if (force) { if (!scene.isLoaded) { SCM.LoadScene(index); } else { SCM.LoadScene(scene.name); } } else if (!scene.isLoaded) { SCM.LoadSceneAsync(index); } else { SCM.LoadSceneAsync(scene.name); } }