Exemplo n.º 1
0
    // Action Event of Pressing Hit Button
    public void HitTimer()
    {
        // Get Result of Hit (BAD, GOOD, GREAT, PERFECT)
        Hit = timerSystem.TimerHit();

        // About Combo, Timer Speed related with Combo
        if (Hit == "BAD")
        {
            Combo = 0;
            timerSystem.ResetTimerSpeed(Combo);
            patternSystem.StopPattern(Combo);
        }
        else
        {
            Combo++;
            timerSystem.ChangeTimerSpeed(SpeedbyCombo);
        }

        // About Timer Pattern
        if (Combo >= 4)
        {
            patternSystem.RandomPattern(Combo);
        }


        // About Score
        FinalScore += gradeSystem.Scoring(Hit, Combo);
        Grade       = gradeSystem.Grading(performCount, FinalScore);

        // modify GUI
        GameObject.Find("Canvas").transform.Find("Hit").GetComponent <TMPro.TextMeshProUGUI>().text   = Hit;
        GameObject.Find("Canvas").transform.Find("Score").GetComponent <TMPro.TextMeshProUGUI>().text = FinalScore.ToString();
        GameObject.Find("Canvas").transform.Find("Grade").GetComponent <TMPro.TextMeshProUGUI>().text = Grade;

        StartCoroutine(ReStart());
    }