Skip to content

Instantly share code, notes, and snippets.

Created Mar 23, 2017
What would you like to do?
using UnityEditor;
using UnityEngine;
using UnityEditor.SceneManagement;
public class Sample
static void CreateStage1()
EditorSceneManager.NewScene (NewSceneSetup.EmptyScene, NewSceneMode.Single);
var obj = new GameObject ("sample");
obj.AddComponent<Main> ();
EditorSceneManager.SaveScene (EditorSceneManager.GetActiveScene(), "Assets/sample.unity");
EditorBuildSettings.scenes = new[]{ new EditorBuildSettingsScene ("Assets/sample.unity", true) };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment