示例#1
0
    /*
     * When a note is hit, the user gains points equal to the multiplier
     * Then, the combo counter increases by one
     * If the combo counter >= multiplier, multiplier goes to the next power of two
     */
    public void NoteHit()
    {
        score += multiplier;

        IncreaseCombo();
        if (_scoreDisplay != null)
        {
            _scoreDisplay.SetAll(score, combo, multiplier);
        }
        _hits++;
    }
示例#2
0
    void Update()
    {
        // When the game scene is loaded, initialize and set up the scoreboard
        // Should probably refactor this into an OnSceneLoad event or something like that
        if (scorePanel == null && (SceneManager.GetActiveScene().name == "Game" || SceneManager.GetActiveScene().name == "TestingGame"))
        {
            scorePanel = GameObject.FindGameObjectWithTag("ScorePanel");

            score      = 0;
            combo      = 0;
            multiplier = 1;

            if (scorePanel != null)
            {
                _scoreDisplay = scorePanel.GetComponent <ScoreDisplay>();
                _scoreDisplay.SetAll(score, combo, multiplier);
            }
        }
    }