Skip to content

Instantly share code, notes, and snippets.

@sassembla
Created August 28, 2018 01:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sassembla/8a269be93917d28fe488e3632e599c5e to your computer and use it in GitHub Desktop.
Save sassembla/8a269be93917d28fe488e3632e599c5e to your computer and use it in GitHub Desktop.
UnityEditorでPlay中にコンパイルが走った時にコンパイル直後にPlayを停めてくれるやつ
using UnityEditor;
using UnityEngine;
public class StopAfterCompileProcess
{
[UnityEditor.Callbacks.DidReloadScripts]
public static void StopAfterCompile()
{
if (EditorApplication.isPlaying)
{
Debug.Log("stop play by StopAfterCompile");
EditorApplication.isPlaying = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment