Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/Sample.cs
Created Mar 23, 2017

Embed
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
You can’t perform that action at this time.