private void OnStateChange(string data) { int id = System.Convert.ToInt32(data); switch (id) { case 0: _state = GPConnectionState.STATE_UNCONFIGURED; break; case 1: _state = GPConnectionState.STATE_DISCONNECTED; dispatch(PLAYER_DISCONNECTED); break; case 2: _state = GPConnectionState.STATE_CONNECTING; break; case 3: _state = GPConnectionState.STATE_CONNECTED; dispatch(PLAYER_CONNECTED); break; } if (!_isInitialized) { _isInitialized = true; dispatch(CONNECTION_INITIALIZED); } Debug.Log("State Changed -> " + _state.ToString()); }
private void OnStateChange(GPConnectionState connectionState) { _State = connectionState; switch (_State) { case GPConnectionState.STATE_CONNECTED: ActionPlayerConnected(); break; case GPConnectionState.STATE_DISCONNECTED: ActionPlayerDisconnected(); break; } ActionConnectionStateChanged(_State); Debug.Log("Play Serice Connection State -> " + _State.ToString()); }
private void OnStateChange(GPConnectionState connectionState) { _state = connectionState; switch (_state) { case GPConnectionState.STATE_CONNECTED: ActionPlayerConnected(); dispatch(PLAYER_CONNECTED); break; case GPConnectionState.STATE_DISCONNECTED: ActionPlayerDisconnected(); dispatch(PLAYER_DISCONNECTED); break; } ActionConnectionStateChanged(_state); dispatch(CONNECTION_STATE_CHANGED, _state); Debug.Log("Play Serice Connection State -> " + _state.ToString()); }