Created
October 7, 2015 22:57
-
-
Save torahhorse/6f2afaaf9db988453596 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 UnityEngine; | |
using UnityEditor; | |
public class EditorSceneShortcuts : MonoBehaviour | |
{ | |
// Edit this line to define your shortcut in the editor | |
// In this example, #1 is the shortcut | |
// % = ctrl (win) or cmd (osx) | |
// # = shift | |
// & = alt | |
// _ = no key modifier | |
[MenuItem ("Scene Shortcuts/Edit Scene1 #1", false, 0)] | |
public static void EditScene1() | |
{ | |
if( EditorApplication.SaveCurrentSceneIfUserWantsTo() ) | |
EditorApplication.OpenScene("Assets/Scene1.unity"); | |
} | |
// Each scene should have its own function + shortcut. Make sure to replace Scene1, Scene 2 etc | |
// This function is just here to show you what to duplicate | |
[MenuItem ("Scene Shortcuts/Edit Scene2 #2", false, 0)] | |
public static void EditScene2() | |
{ | |
if( EditorApplication.SaveCurrentSceneIfUserWantsTo() ) | |
EditorApplication.OpenScene("Assets/Scene2.unity"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment