public void OnCollisionEnter(Collision c)
    {
        if (c.gameObject.tag == "Player" && justHit == false)
        {
            if (notHit)
            {
                CreditManager.victimNumbers.Add(1);
                notHit = false;
            }

            ouch.Play();
            GoingOffRoadDemeritCounter.setDemerits(20);

            float speed = bob.CurrentSpeed;

            GetComponent <CharacterController>().enabled = false;
            this.GetComponent <Animator>().enabled       = false;
            GetComponent <rotate180>().enabled           = false;

            GetComponent <CapsuleCollider>().enabled = false;
            GetComponent <Rigidbody>().isKinematic   = false;

            GetComponent <Rigidbody>().AddForce(bob.transform.forward * (speed));
            GetComponent <Rigidbody>().useGravity    = true;
            GetComponent <CapsuleCollider>().enabled = true;

            StartCoroutine(flashTime(3, PedHit)); //Change the first parameter of flashTime to change the amount of time the text is on.
            StartCoroutine(hitTime());
        }
    }
    public void OnCollisionEnter(Collision c)
    {
        if (c.gameObject.tag == "Player" && justHit == false)
        {
            if (notHit)
            {
                CreditManager.victimNumbers.Add(5);
                notHit = false;
            }
            ouch.Play();
            GoingOffRoadDemeritCounter.setDemerits(20);

            // THIS IS WHERE TO ADD PEDESTRIAN PHYSICS

            // (1) Stop 'walking' Animation from playing
            //     switch to idle "default" mode
            //     just add a condition in transitions
            //      in animator window

            // (2) Get the direction of where pedestrian was hit ..?
            // this would be 'transform.forward' below ....?

            // (3) Apply force to pedestrian (need rigidbody component for this part)
            //GetComponent<Rigidbody>().AddForce(transform.forward * 500);
            //GetComponent<Rigidbody>().useGravity = true;

            //////////////////////////////////////////

            StartCoroutine(flashTime(3, PedHit)); //Change the first parameter of flashTime to change the amount of time the text is on.
            StartCoroutine(hitTime());
        }
    }
 public void OnCollisionEnter(Collision c)
 {
     if (c.gameObject.tag == "Player" && justHit == false)
     {
         GoingOffRoadDemeritCounter.setDemerits(20);
         StartCoroutine(flashTime(3, PedHit)); //Change the first parameter of flashTime to change the amount of time the text is on.
         StartCoroutine(hitTime());
     }
 }
 public void OnCollisionEnter(Collision c)
 {
     if (c.gameObject.tag == "Player" && justHitCar == false)
     {
         if (notHit)
         {
             CreditManager.victimNumbers.Add(3);
             notHit = false;
         }
         crash.Play();
         GoingOffRoadDemeritCounter.setDemerits(10);
         StartCoroutine(flashTime(3, CarHit)); //Change the first parameter of flashTime to change the amount of time the text is on.
         StartCoroutine(hitTimeCar());
     }
 }
    IEnumerator Credits()
    {
        finalScore.SetActive(true);
        demeritCountText.SetActive(true);

        //just use all return functions for individual scores and add here
        finalScoreText.text = "Demerits: " + (GoingOffRoadDemeritCounter.getDemerits()).ToString();

        yield return(new WaitForSeconds(5));        //Use this for gaps between slides

        //set slides active and not active
        //use if-statements for choosing specific slides
        finalScore.SetActive(false);
        demeritCountText.SetActive(false);
        printStory();
    }
    void Update()
    {
        //Whenever user hits object, update count appropriately



        //Below is just an example to show that the count works
        //You could just click your mouse while running in play mode
        //if (Input.GetMouseButtonDown (0)) {
        //	count++;
        //}


        //Display new count
        demeritCount.text = "Demerits: " + (GoingOffRoadDemeritCounter.getDemerits() + count).ToString();
    }