Esempio n. 1
0
    void AddScore(RaceRing ring)
    {
        if (remainingRings > 0)
        {
            remainingRings--;
            UpdateScore();
        }

        //see how this is done in deliverable 1
        ding.Play();
    }
    // Called when the player goes through a ring in the correct direction
    private void Checkpoint(RaceRing ring)
    {
        // increment the index
        nextIndex++;

        // Check if the course was completed
        if (nextIndex > rings.Length - 1)
        {
            finished  = true;
            finalTime = Time.time - timeStart;

            return;
        }

        // activate the next ring
        rings[nextIndex].trigger.enabled = true;
    }
 // Called when the player goes through a ring in the incorrect direction
 private void Penalty(RaceRing ring)
 {
     // Add a time penalty to the clock
     timeStart -= timePenalty;
 }