void Awake() { estado1 = new AIEstadoHold(); estado2 = new AIEstadoPersecucion(); estadoActual = estado1; estadoActual.Iniciar(this); }
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); }