|
|
|
|
|
|
var result = m_Client.Exchange(WrapMessage(unityOutput, 200)); |
|
|
|
unityInput = m_Client.Exchange(WrapMessage(null, 200)).UnityInput; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#if UNITY_2017_2_OR_NEWER
|
|
|
|
#else
|
|
|
|
EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged; |
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return result.UnityInput; |
|
|
|
#else
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
#if UNITY_2017_2_OR_NEWER
|
|
|
|
/// <summary>
|
|
|
|
/// When the editor exits, the communicator must be closed
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#else
|
|
|
|
/// <summary>
|
|
|
|
/// When the editor exits, the communicator must be closed
|
|
|
|
/// </summary>
|
|
|
|
private void HandleOnPlayModeChanged() |
|
|
|
{ |
|
|
|
// This method is run whenever the playmode state is changed.
|
|
|
|
if (!EditorApplication.isPlayingOrWillChangePlaymode) |
|
|
|
{ |
|
|
|
Close(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |