Exemplo n.º 1
0
    public IEnumerator CountScore()
    {
        for (int i = finishedTime; i > 0; i--)
        {
            currentScore++;
            currentLevelTime--;
            scoreText.text = currentScore.ToString("000000");
            timeText.text  = currentLevelTime.ToString("0000");
            audioSource.PlayOneShot(scoreCount);
            yield return(new WaitForSeconds(0.005f));
        }

        //Teleport
        timeText.text = "000000";
        audioSource.PlayOneShot(teleportOut);
        playerAnim.Play("teleportOut");
        levelSpawner.gameGrid.AnimateTileTeleport();
        yield return(new WaitForSeconds(teleportOut.length));

        levelSpawner.LoadNextLevel();
    }