Beispiel #1
0
    public void EndLevel(PlayedLevelData playedLevelData)
    {
        _isLevelRunning = false;

        _endLevelOverallScore.text = string.Format("{0:000000}", playedLevelData.overallScore);
        _endLevelPercentage.text   = string.Format("{0:0.00%}", playedLevelData.percentage);
        _endLevelNoteStreak.text   = "" + playedLevelData.noteStreak;

        _endLevelMenu.SetActive(true);
    }
Beispiel #2
0
    private void ShowEndLevelMenu()
    {
        _isRunning = false;
        ToggleLevelUI(false);

        //Calculate final scores and package data
        PlayedLevelData playedLevelData = new PlayedLevelData
        {
            overallScore     = _score,
            notesHit         = _notesHit,
            totalNumberNotes = _totalNumberNotes,
            percentage       = (float)_notesHit / _totalNumberNotes,
            noteStreak       = _longestNoteStreak
        };

        // Go to final screen and menu
        GameObject.FindGameObjectWithTag("MenuController").GetComponent <MenuController>().EndLevel(playedLevelData);
    }