Beispiel #1
0
    void SaveScoreToLeaderboard(string text)
    {
        string path = "Assets/Resources/Leaderboard.txt";

        //Write some text to the test.txt file
        StreamWriter writer = new StreamWriter(path, true);

        writer.WriteLine(text);
        writer.Close();
        sceneLoader.LoadSceneByIndex(0);
    }
Beispiel #2
0
    private void Death()
    {
        dead = true;

        anim.ResetTrigger("Idle");
        anim.ResetTrigger("Run");
        anim.SetBool("Attack", false);
        anim.SetBool("Damaged", false);
        anim.SetBool("Death", true);
        finalScore = scoreBoard.scoreText.text;
        loadScene.LoadSceneByIndex(2);
    }