daily pastebin goal
63%
SHARE
TWEET

SceneCombiner.cs

mvaganov Feb 15th, 2018 (edited) 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top