Ejemplo n.º 1
0
    public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId)
    {
        var player = GameObject.Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);

        NetworkServer.AddPlayerForConnection(conn, player, playerControllerId);
        Debug.Log("Client has requested to get his player added to the game");

        if (NetworkServer.connections.Count == 4)
        {
            serverManager.DistributeCharacters();
            serverManager.DistributePolicies();
            serverManager.BeginTurn();
        }
    }