Skip to content

Instantly share code, notes, and snippets.

@torahhorse
Created October 7, 2015 22:57
Show Gist options
  • Save torahhorse/6f2afaaf9db988453596 to your computer and use it in GitHub Desktop.
Save torahhorse/6f2afaaf9db988453596 to your computer and use it in GitHub Desktop.
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