Exemplo n.º 1
0
        public void Start()
        {
            text.color = TeamUtils.GetAllTeams().GetData()
                         .First(team => team.teamId == settings.teamId)
                         .teamColor;

            TeamUtils.GetAllTeams()
            .Select(teams => teams.First(team => team.teamId == settings.teamId).dataCollection.GetData(settings.key)?.ToString())
            .OnDataChanged()
            .OnDo(value => text.text = value);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Use this to get the team color using the team is
        /// </summary>
        /// <returns>The team color.</returns>
        public static Color GetTeamColor(int teamId)
        {
            var returned = Color.white;

            var teamData = TeamUtils.GetAllTeams().GetData()
                           .FirstOrDefault(team => team.teamId == teamId);

            if (teamData != null)
            {
                returned = teamData.teamColor;
            }

            return(returned);
        }
Exemplo n.º 3
0
        private void Refresh()
        {
            bool isLocked = capturePointData.lockedTeams.Count >= TeamUtils.GetAllTeams().GetData().Count();

            Color color;
            var   teamId = capturePointData.teamId;

            if (teamId > 0)
            {
                color = TeamUtils.GetAllTeams().GetData()
                        .First(team => team.teamId == teamId).teamColor;
            }
            else
            {
                color = Color.white;
            }

            float colorMultiplier = (isLocked) ? .5f : 1f;

            renderer.material.color = new Color(color.r * colorMultiplier, color.g * colorMultiplier, color.b * colorMultiplier);
        }
Exemplo n.º 4
0
        private void Start()
        {
            var teamColor = TeamUtils.GetTeamColor(playerData.teamId);

            renderer.material.color = teamColor;
        }