Ejemplo n.º 1
0
 void TravelToTarget()
 {
     travelTimeTarget_ += Time.deltaTime;
     if (travelTimeTarget_ > travelSpeed_)
     {
         GameObject toRemove = null;
         foreach (GameObject bodyPartGO in toTarget_)
         {
             //TentaclePart bodyPart = bodyPartGO.GetComponent<TentaclePart>();
             if (bodyPartGO.transform.position != tentacle_.Target_.transform.position)
             {
                 bodyPartGO.transform.position = Vector3.MoveTowards(bodyPartGO.transform.position, tentacle_.Target_.transform.position, Tentacle.fastTravelSpeed_ * Time.deltaTime);
             }
             if (bodyPartGO.transform.position == tentacle_.Target_.transform.position)
             {
                 toRemove = bodyPartGO;
             }
         }
         if (toRemove != null)
         {
             toTarget_.Remove(toRemove);
             tentacle_.InjectPart(toRemove);
         }
         travelTimeTarget_ = 0;
     }
 }