Ejemplo n.º 1
0
    public void EnqueueScore(uint netId, int amount)
    {
        PlayerProfile playerProfile = _playerProfiles.Find((profile) => netId == profile.netId);
        InComingScore incomingScore = new InComingScore();

        incomingScore.PlayerProfile = playerProfile;
        incomingScore.Amount        = amount;

        _incomingScorePoints.Enqueue(incomingScore);
    }
Ejemplo n.º 2
0
    public IEnumerator UpdateScoreCoroutine(InComingScore incomingScore)
    {
        // We update the score here, then the hook gets called for the clients and updates the score text
        int newScore = incomingScore.PlayerProfile.Score + incomingScore.Amount;

        RpcSetScore(incomingScore.PlayerProfile.netId, newScore);

        _updateScoreCoroutine = null;

        yield break;
    }