// Update is called once per frame void Update() { float maxScoreCrown = 0; float checkEquality = _scores[0].TotalScore; bool scoresEqual = false; ZMScoreController maxScoreController = null; // see if the scores are equal for (int i = 1; i < Settings.MatchPlayerCount.value; ++i) { _leadingPlayerIndex = -1; if (_scores[i].TotalScore == checkEquality) { scoresEqual = true; } } for (int i = 0; i < Settings.MatchPlayerCount.value; ++i) { var scoreController = _scores[i]; if (scoreController.TotalScore > maxScoreCrown && !scoresEqual) { _leadingPlayerIndex = i; _lobbyDominator = false; maxScoreCrown = scoreController.TotalScore; maxScoreController = scoreController; } if (_crowns[i] != null && !_lobbyDominator) { _crowns[i].GetComponent <Text>().color = Color.white; } } if (maxScoreController != null && !_lobbyDominator) { _crowns[maxScoreController.PlayerInfo.ID].GetComponent <Text>().color = Color.yellow; } else if (_lobbyDominator && _dominatorIndex < _crowns.Length) { _crowns[_dominatorIndex].GetComponent <Text>().color = Color.yellow; } }
void Start() { _particles.GetComponent <Renderer>().material.color = Utilities.GetRGB(_particles.GetComponent <Renderer>().material.color, _playerInfo.standardColor); _scoreController = ZMPlayerManager.Instance.Scores[_playerInfo.ID]; }
public void ClientReady(ZMScoreController scoreController) { Debug.Log(gameObject.name + ": client ready!"); }