Created
November 14, 2017 02:39
-
-
Save ajboni/a3413fe81c0dd47f0ff5bc051ffb5e88 to your computer and use it in GitHub Desktop.
Unity MultiScene Launcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.SceneManagement; | |
| namespace UAE | |
| { | |
| public class SceneLauncher : MonoBehaviour | |
| { | |
| // Use this for initialization | |
| void Awake() | |
| { | |
| //if (!Application.isEditor) | |
| //{ | |
| int sceneCount = UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings; | |
| if (sceneCount > 1) | |
| { | |
| for (int i = 1; i < sceneCount; i++) | |
| { | |
| SceneManager.LoadScene(i, LoadSceneMode.Additive); | |
| Debug.Log("Loaded Scene: " + SceneUtility.GetScenePathByBuildIndex(i)); | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment