Created
June 7, 2016 16:53
-
-
Save StagPoint/15828d03feb64e6930968f70c869a5d9 to your computer and use it in GitHub Desktop.
Stop Play Mode in the Unity Editor when recompiling the code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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