|
|
|
|
|
|
|
|
|
|
unityInput = UnityMessage.Parser.ParseFrom(Receive()).UnityInput; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#if UNITY_2017_2_OR_NEWER
|
|
|
|
#else
|
|
|
|
EditorApplication.playmodeStateChanged += HandleOnPlayModeChanged; |
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
return initializationInput.UnityInput; |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
#if UNITY_2017_2_OR_NEWER
|
|
|
|
void HandleOnPlayModeChanged(PlayModeStateChange state) |
|
|
|
private void HandleOnPlayModeChanged(PlayModeStateChange state) |
|
|
|
if (state == PlayModeStateChange.ExitingPlayMode) |
|
|
|
if (state==PlayModeStateChange.ExitingPlayMode) |
|
|
|
#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
|
|
|
|
|
|
|
|
} |