Skip to content

Instantly share code, notes, and snippets.

@StagPoint
Created June 7, 2016 16:53
Show Gist options
  • Save StagPoint/15828d03feb64e6930968f70c869a5d9 to your computer and use it in GitHub Desktop.
Save StagPoint/15828d03feb64e6930968f70c869a5d9 to your computer and use it in GitHub Desktop.
Stop Play Mode in the Unity Editor when recompiling the code
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
EditorApplication.update = () =>
{
if( EditorApplication.isCompiling )
{
EditorApplication.isPlaying = false;
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment