Skip to content

Instantly share code, notes, and snippets.

@arkms
Last active Jun 7, 2019
Embed
What would you like to do?
Add to Unity the possibility to PLAY with just F6 and PAUSA with F7. Just download the script and put inside the "Editor" folder.
namespace Arj2D
{
public class ShortCutKeys
{
private const string MENU_EXTRA_RUN = "Edit/Extra/Run _F6";
private const string MENU_EXTRA_PAUSE = "Edit/Extra/Run _F7";
[MenuItem(MENU_EXTRA_RUN)]
private static void Run()
{
EditorApplication.isPlaying = true;
}
[MenuItem(MENU_EXTRA_RUN, true)]
private static bool CanRun()
{
return !EditorApplication.isPlaying;
}
[MenuItem(MENU_EXTRA_PAUSE)]
private static void Pause()
{
EditorApplication.isPaused = !EditorApplication.isPaused;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment