Advertisement
mvaganov

SceneCombiner.cs

Feb 15th, 2018
315
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. // author: mvaganov@hotmail.com
  7. // license: Copyfree, public domain. This is free code! Great artists, steal this code!
  8. // latest version at: https://pastebin.com/raw/8cZ5yKSd
  9. // works well with Singleton: https://pastebin.com/raw/JMme8A2X
  10. public class SceneCombiner : MonoBehaviour {
  11.     [Tooltip("What scenes to combine together.\nConsider having objects with 'Singleton' in the Scenes to prevent duplication.")]
  12.     public UnityEditor.SceneAsset[] scenesToAdd;
  13.     // Use this for initialization
  14.     void Start () {
  15.         for (int i = 0; i < scenesToAdd.Length; ++i) {
  16.             SceneManager.LoadScene (scenesToAdd [i].name, LoadSceneMode.Additive);
  17.         }
  18.     }  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement