Example #1
0
 public void FindTarget()
 {
     if (npcManager != null)
     {
         target = npcManager.GetClosestFleetShip(transform.position);
         if (target.GetComponent <Fleetship>() != null)
         {
             target = target.GetComponent <Fleetship>().GetClosestShipPart(transform.position).gameObject;
         }
         else
         {
             target = npcManager.GetClosestTarget(transform.position);
         }
     }
 }