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); }
/// <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); }
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); }