Created
July 8, 2013 01:15
-
-
Save asus4/5945601 to your computer and use it in GitHub Desktop.
Unity Open Scene Editor Utility
This file contains hidden or 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 UnityEngine; | |
using UnityEditor; | |
namespace MyProject { | |
/// <summary> | |
/// Open Scene Editor Tools. | |
/// </summary> | |
public class OpenSceneTool : EditorWindow { | |
#region life cycle | |
void OnGUI () { | |
this.OpenScenes(); | |
} | |
#endregion | |
#region private | |
void OpenScenes() { | |
GUILayout.Label ("Open Scene", EditorStyles.boldLabel); | |
EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes; | |
foreach(EditorBuildSettingsScene scene in scenes) { | |
if(GUILayout.Button(scene.path)){ | |
EditorApplication.OpenScene(scene.path); | |
} | |
} | |
} | |
#endregion | |
#region static | |
[MenuItem ("Tools/Project/OpenScenes")] | |
public static void MakeWindow() { | |
EditorWindow.GetWindow<OpenSceneTool>(true, "Open Scenes"); | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment