예제 #1
0
 // use case: round fail
 // for use with detecting collision of walls.
 void OnCollisionEnter(Collision col)
 {
     // destroy the plane anytime it collides with a wall
     if (col.gameObject.tag == "Floor" && !finished)
     {
         //StartCoroutine(WaitThenReset());
         fpScript.DestroyPlaneAndReset();
     }
 }
예제 #2
0
    // need to use and IEnumerator here so that the
    // game waits before resetting
    IEnumerator WaitThenReset()
    {
        yield return(new WaitForSeconds(3));

        fpScript.DestroyPlaneAndReset();
    }