public override bool CanEnter(MemoryEvent target) { if (!PatrolManager.instance) { Debug.LogWarning("No Patrol Manager on map"); return(false); } pretendingPath = PatrolManager.instance.GetRandomUnusedPath(transform.position - PatrolManager.instance.transform.position, maxPatrolPathDistance); return(pretendingPath != null); }
public override void Beggin() { currentPath = pretendingPath; pointId = currentPath.GetClosestPointId(transform.position - PatrolManager.instance.transform.position); if (pointId == 0) { direction = 1; } else if (pointId == currentPath.points.Length - 1) { direction = -1; } else { direction = Random.Range(0, 2) * 2 - 1; // +1 or -1 } }