Advertisement
mvaganov

SceneCombiner.cs

Feb 15th, 2018
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5.  
  6. // license: Copyfree, public domain. This is free code! Great artists, steal this code!
  7. // latest version at: https://pastebin.com/raw/8cZ5yKSd
  8. // works well with Singleton: https://pastebin.com/raw/JMme8A2X
  9. public class SceneCombiner : MonoBehaviour {
  10.     [Tooltip("What scenes to combine together.\nConsider having objects with 'Singleton' in the Scenes to prevent duplication.")]
  11.     public UnityEditor.SceneAsset[] scenesToAdd;
  12.     // Use this for initialization
  13.     void Start () {
  14.         for (int i = 0; i < scenesToAdd.Length; ++i) {
  15.             SceneManager.LoadScene (scenesToAdd [i].name, LoadSceneMode.Additive);
  16.         }
  17.     }  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement