For this question I am using 4.1.9, with AIPath, Seeker, and modifiers.
Prior to movement, the AI will use MultiTargetPath to determine which points of interest it can move to and how far away they are. In the callback, it will pick one of those points, setting AIDestinationSetter.target.
However, this seems inefficient since the same path is calculated twice, once to see if it is reachable, and again by AIBase.SearchPath(). It also causes an unnecessary delay, because I have to wait for repathRate before starting on the new path.
This is my workaround, although I had to make protected functions public to do it.
multiTargetPath.SetPathParametersForReturn(pathIdx);
// Act as if a new search had been requested
aIPath.OnSearchPath();
// Run modifiers
seeker.RunModifiers(Seeker.ModifierPass.PostProcess, multiTargetPath);
// Act as if a new search had been completed
aIPath.OnPathComplete(multiTargetPath);
aiPath.lastRepath = Time.time;
Is this the right approach or is there a better way?