Beispiel #1
0
 //Trigger entry detection
 public void OnTriggerEnter(Collider col)
 {
     //Landing pad contact
     if (col.gameObject.tag == "Pad" && IsLanded == false)
     {
         Debug.Log("landing pad enter: " + col.gameObject.name);
         LandingPad lp = col.gameObject.GetComponentInChildren <LandingPad>();
         Debug.Log("ENTER: " + col.gameObject.name + "CURRENT: " + navigationComputer.CurrentLandingPad.name);
         if (lp != navigationComputer.CurrentLandingPad)
         {
             //Debug.Log("VELOCITY: "+ plane.gameObject.GetComponent<Rigidbody>().velocity.magnitude);
             //if (plane.gameObject.GetComponent<Rigidbody>().velocity.magnitude <= 1f)
             //{
             Debug.Log("CONTACT");
             StartCoroutine(LandingPadContactHandler(lp));
             //}
         }
     }
     else if (col.gameObject.tag == "Waypoint")
     {
         col.GetComponent <Collider>().enabled = false;
         Debug.Log("waypoint enter: " + col.gameObject.name);
         IsLanded = false;
         pathNavigator.WaypointPassed();
     }
     else if (col.gameObject.tag == "Tunnel")
     {
         Debug.Log("course tunnel hit");
         soundController.OffCourseWarning();
     }
 }