Ejemplo n.º 1
0
 public void Spawn()
 {
     if (isSpawned == false)
     {
         spawnedObject    = Instantiate(prefab, transform.position, transform.rotation);
         isSpawned        = true;
         spawnedTransform = spawnedObject.GetComponent <Transform>();
         WaypointNavigator waypointNavigator = spawnedObject.GetComponent <WaypointNavigator>();
         if (nextWaypoint != null)
         {
             waypointNavigator.CurrentWaypoint(nextWaypoint);
         }
         else
         {
             waypointNavigator.CurrentWaypoint(previousWaypoint);
         }
     }
 }