Esempio n. 1
0
        /// <summary>
        ///     Creates the team view from the data given
        /// </summary>
        /// <param name="teamName"></param>
        /// <param name="teamProperties"></param>
        /// <returns></returns>
        protected virtual LobbyTeamUi CreateTeamView(string teamName,
                                                     LobbyTeamData data)
        {
            var teamView = TeamsPool.GetResource();

            teamView.Setup(teamName, data);
            teamView.gameObject.SetActive(true);
            teamView.transform.SetParent(TeamsLayoutGroup.transform, false);
            teamView.transform.SetAsLastSibling();

            return(teamView);
        }
Esempio n. 2
0
        /// <summary>
        ///     Sets up the team view from the data given
        /// </summary>
        /// <param name="teamName"></param>
        /// <param name="properties"></param>
        public virtual void Setup(string teamName, LobbyTeamData data)
        {
            RawData = data;

            Name = teamName;
            UpdateName();

            // Toggle header
            if (string.IsNullOrEmpty(teamName) && DisableHeaderIfNameIsEmpty)
            {
                Header.SetActive(false);
            }
            else
            {
                Header.SetActive(true);
            }
        }
Esempio n. 3
0
        public virtual void OnMemberTeamChanged(LobbyMemberData member, LobbyTeamData team)
        {
            LobbyUserUi user;

            Users.TryGetValue(member.Username, out user);

            if (user == null)
            {
                return;
            }

            // Player changed teams
            var newTeam = Teams[team.Name];

            user.transform.SetParent(newTeam.UsersLayoutGroup.transform, false);

            if (member.Username == CurrentUser)
            {
                UpdateReadyButton();
            }

            UpdateTeamJoinButtons();
            UpdateStartGameButton();
        }