public void FindNextTarget() { movingPath.Reset(); MapNode curNode = GetPosition(); MapNode nextNode = curNode; while (nextNode == null || nextNode == curNode || nextNode.IsWall()) { int x = Random.Range(bornX - wanderDistance, bornX + wanderDistance); int y = Random.Range(bornY - wanderDistance, bornY + wanderDistance); nextNode = MapHandler.GetMapNode(x, y); } List <Vector2> path = MapHandler.FindPath(curNode, nextNode); SetPath(path); }
public void ResetPath() { movingPath.Reset(); }