private void handleBytes(byte[] data) { string str = Encoding.ASCII.GetString(data); Debug.Log(str); char c = str [0]; if (c == 'L') { CoopWorldInput.PressKey(id, CoopWorldInput.CoopKeyCode.Left); } else if (c == 'R') { CoopWorldInput.PressKey(id, CoopWorldInput.CoopKeyCode.Right); } else if (c == 'l') { CoopWorldInput.UnpressKey(id, CoopWorldInput.CoopKeyCode.Left); } else if (c == 'r') { CoopWorldInput.UnpressKey(id, CoopWorldInput.CoopKeyCode.Right); } }
public void OnPlayerConnect(int playerId) { CoopWorldInput.AddNewInput(playerId); connectData.ConnectOccured(playerId); }