using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using UnityEngine;
public class enemy_AI : MonoBehaviour
{
public Transform target;
public float speed = 200f;
public float nextWaypointDistance = 3f;
Path path;
float currentWaypoint = 0f;
bool reachedEndOfPath = false;
Seeker seeker;
Rigidbody2D rb;
void Start()
{
seeker = GetComponent();
rb = GetComponent();
seeker.StartPath(rb.position, target.position, OnPathComplete);
}
void OnPathComplete(Path p)
{
if (!p.error)
{
Path = p;
currentWaypoint = 0f;
}
}
void Update()
{
}
}