Exemple #1
0
    public void YouLose()
    {
        isAlive          = false;
        musicPlayer.clip = loseSound;
        musicPlayer.Play();
        musicPlayer.loop = false;
        int score = ((int)Mathf.Round(playerPosition * 10) + (coins * 10) + (int)Mathf.Round(timeAlive * 5));

        RuntimeData.myScore = score;
        fileIO.AddScore(score);
        fileIO.Save();
        Invoke("ChangeScene", loseSound.length);
    }