public override void OnClientConnect(NetworkConnection conn) { base.OnClientConnect(conn); var charMessage = new CreateTicTacToePlayerMessage { role = numPlayers == 0 ? 0 : 1 }; conn.Send(charMessage); }
public void OnCreatePlayer(NetworkConnection conn, CreateTicTacToePlayerMessage message) { GameObject gameobject = Instantiate(playerPrefab, GameObject.FindGameObjectWithTag("Player Container").transform, false); NetworkServer.AddPlayerForConnection(conn, gameobject); }