Skip to content

Instantly share code, notes, and snippets.

@arkms
Last active June 7, 2019 12:40
Show Gist options
  • Save arkms/490f400758ef262f7b864079ec311ba2 to your computer and use it in GitHub Desktop.
Save arkms/490f400758ef262f7b864079ec311ba2 to your computer and use it in GitHub Desktop.
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