We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad72ed5 commit dc59563Copy full SHA for dc59563
Scripts/Editor/EditorShortCutKeys.cs
@@ -0,0 +1,20 @@
1
+using UnityEngine;
2
+using UnityEditor;
3
+using UnityEditor.SceneManagement;
4
+using UnityEngine.SceneManagement;
5
+
6
+// original source by "Mavina" http://answers.unity3d.com/answers/1204307/view.html
7
+// usage: Place this script into Editor/ folder, then you can press F5 to enter/exit Play Mode
8
9
+public class EditorShortCutKeys : ScriptableObject
10
+{
11
+ [MenuItem("Edit/Run _F5")] // shortcut key F5 to Play (and exit playmode also)
12
+ static void PlayGame()
13
+ {
14
+ if (!Application.isPlaying)
15
16
+ EditorSceneManager.SaveScene(SceneManager.GetActiveScene(), "", false); // optional: save before run
17
+ }
18
+ EditorApplication.ExecuteMenuItem("Edit/Play");
19
20
+}
0 commit comments