DarkRift
DarkRift copied to clipboard
UnityServer does not close in editor
To fix it, it should be enough to add:
#if UNITY_EDITOR
EditorApplication.playModeStateChanged += (state) =>
{
if (state == PlayModeStateChange.ExitingPlayMode)
{
Close();
}
};
#endif
In the OnEnable of the UnityServer. Make sure to also put the using UnityEditor in #if UNITY_Editor