Пример #1
0
    public override void CreatePlayer(RpcArgs args)
    {
        string playerName = args.GetNext <string>();
        int    playerTeam = args.GetNext <int>();

        LobbyPlayerElement playerElement = Instantiate(playerElementPrefab).GetComponent <LobbyPlayerElement>();

        playerElement.Init(playerName, teamParents[playerTeam]);

        players.Add(new LobbyPlayer(playerElement, playerName, playerTeam));
    }
Пример #2
0
 public void ChangeTeam(int teamIndex, RectTransform parent)
 {
     this.playerTeam = teamIndex;
     lobbyPlayerElement.Init(playerName, parent);
 }