Skip to content

Instantly share code, notes, and snippets.

@keiranlovett
Forked from zapdot/StopPlayingOnRecompile.cs
Created January 19, 2016 08:05
Show Gist options
  • Save keiranlovett/50745882be12a1909438 to your computer and use it in GitHub Desktop.
Save keiranlovett/50745882be12a1909438 to your computer and use it in GitHub Desktop.
Stop Playing on Recompile
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
EditorApplication.update = () =>
{
if (EditorApplication.isCompiling && EditorApplication.isPlaying)
EditorApplication.isPlaying = false;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment