示例#1
0
    IEnumerator UpdateScore()
    {
        while (board.HasEmptySquares)
        {
            yield return(null);
        }
        yield return(null);

        if (tempScore > 0)
        {
            //add seconds if the score that is earned is high enough
            if (tempScore > 500)
            {
                countDownScript.AddTime((int)(tempScore / 500));
            }
            //here we are going to randomize the text based on what score the player got, afterwards we will return a random, rewarding message for the player
            //-Koester
            int random = (Random.Range(0, 4));
            randomText.Congradulate();
            GameObject.Find("Score").GetComponent <AddingScore>().AddScore(tempScore);
            tempScore = 0;
        }
    }