public void AddTeammate(long id, string avatarId, int rank) { foreach (UserLabelComponent component in this.teammatesList.GetComponentsInChildren <UserLabelComponent>(true)) { if (component.UserId == id) { return; } } UserLabelBuilder builder = new UserLabelBuilder(id, Instantiate <GameObject>(this.teammate.gameObject), avatarId, false); builder.SetLeague(rank); GameObject obj2 = builder.Build(); obj2.transform.SetParent(this.teammatesList, false); obj2.gameObject.SetActive(true); }
public void SetUserLabel(NodeAddedEvent e, UserNode user, [Context, JoinByUser] UserLabelIndicatorNode userLabelIndicator, [JoinByScoreTable] ScoreTableNode scoreTable) { GameObject userLabel = userLabelIndicator.scoreTableUserLabelIndicator.userLabel; bool premium = user.Entity.HasComponent <PremiumAccountBoostComponent>(); UserLabelBuilder builder = new UserLabelBuilder(user.Entity.Id, userLabel, user.userAvatar.Id, premium); LeagueNode node = base.Select <LeagueNode>(user.Entity, typeof(LeagueGroupComponent)).FirstOrDefault <LeagueNode>(); if (node != null) { builder.SetLeague(node.leagueConfig.LeagueIndex); } builder.SkipLoadUserFromServer(); if (scoreTable.scoreTableUserAvatar.EnableShowUserProfileOnAvatarClick) { builder.SubscribeAvatarClick(); } builder.Build(); }