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)); }
public void ChangeTeam(int teamIndex, RectTransform parent) { this.playerTeam = teamIndex; lobbyPlayerElement.Init(playerName, parent); }