Skip to content

Instantly share code, notes, and snippets.

@ajboni
Created November 14, 2017 02:39
Show Gist options
  • Select an option

  • Save ajboni/a3413fe81c0dd47f0ff5bc051ffb5e88 to your computer and use it in GitHub Desktop.

Select an option

Save ajboni/a3413fe81c0dd47f0ff5bc051ffb5e88 to your computer and use it in GitHub Desktop.
Unity MultiScene Launcher
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