ScoreKeeper.AliveScoreTicker C# (CSharp) Méthode

AliveScoreTicker() public méthode

public AliveScoreTicker ( ) : IEnumerator
Résultat IEnumerator
    public IEnumerator AliveScoreTicker()
    {
        //this loop will run forever so you can just call AddScore and the ticker will continue automatically
        while (true){
            if(!playerCharacter.playerDead){
                //Use the Ticker function to rapidly increment toward the actual score
                ScoreKeeper.DisplayScore = Ticker(ScoreKeeper.DisplayScore, ScoreKeeper.Score, scoreTickInterval);
            }
            //wait for some time before incrementing again
            yield return new WaitForSeconds(scoreTickSpeed);
        }
    }