Example #1
0
 void OnTriggerEnter(Collider other)
 {
     if (!transform.parent.Equals(other.transform.parent) &&
         other.gameObject.tag.Equals("Truck"))
     {
         EGFiretruck otherTruck   = other.transform.root.gameObject.GetComponent <EGFiretruck>();
         Vector3     closestPoint = other.ClosestPointOnBounds(truck.GetPosition());
         if (otherTruck != null)
         {
             truck.addOtherTruck(other.transform.root.gameObject, closestPoint);
         }
     }
 }