//horizontal|vertical|A|B|start|perfil private void ServerReceiveMessage(NetworkMessage message) { StringMessage msg = new StringMessage(); msg.value = message.ReadMessage <StringMessage>().value; string[] values = msg.value.Split('|'); float horizontal = float.Parse(values[0]); float vertical = float.Parse(values[1]); int valueA = int.Parse(values[2]); int valueB = int.Parse(values[3]); int valueStart = int.Parse(values[4]); int ValuePerfil = int.Parse(values[5]); int idPlayer = int.Parse(values[6]); if (gameMenuController != null) { if (idPlayer == 1) { gameMenuController.ConnectPlayer1(); } else { gameMenuController.ConnectPlayer2(); } } if (inputPlayer1 != null && inputPlayer2 != null) { if (idPlayer == 1) { inputPlayer1.SetPad(new Vector2(horizontal, vertical)); inputPlayer1.SetButtonA(ConvertInt2BoolButton(valueA, ref oldValueA)); inputPlayer1.SetButtonB(ConvertInt2BoolButton(valueB, ref oldValueB)); } else { inputPlayer2.SetPad(new Vector2(horizontal, vertical)); inputPlayer2.SetButtonA(ConvertInt2BoolButton(valueA, ref oldValueA)); inputPlayer2.SetButtonB(ConvertInt2BoolButton(valueB, ref oldValueB)); } } else if (gameController != null) { inputPlayer1 = gameController.GetPlayer1().GetInput(); inputPlayer2 = gameController.GetPlayer2().GetInput(); } }
private void Start() { input = new MultiplayerAkiraInput(); playerAnim = GetComponentInChildren <Animator>(); DontDestroyOnLoad(gameObject); }