Ejemplo n.º 1
0
 void Awake()
 {
     estado1      = new AIEstadoHold();
     estado2      = new AIEstadoPersecucion();
     estadoActual = estado1;
     estadoActual.Iniciar(this);
 }
Ejemplo n.º 2
0
 void Awake()
 {
     estado1      = new AIEstadoRonda();
     estado2      = new AIEstadoPersecucion();
     estadoActual = estado1;
     waypoints    = new Vector3[pathHolder.childCount];
     for (int i = 0; i < waypoints.Length; i++)
     {
         waypoints[i] = pathHolder.GetChild(i).position;
         waypoints[i] = new Vector3(waypoints[i].x, transform.position.y, waypoints[i].z);
     }
     transform.position  = waypoints[0];
     targetWaypointIndex = 1;
     targetWaypoint      = waypoints[targetWaypointIndex];
     transform.LookAt(targetWaypoint);
     estadoActual.Iniciar(this, targetWaypoint, targetWaypointIndex);
 }