Created
March 23, 2017 16:01
-
-
Save tsubaki/d60a7ab80ca0bdb8094884dd59b7feb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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