/// <summary> /// Calculates a path using custom logic /// </summary> /// <param name="start">start point</param> /// <param name="isGoal">function says if the node is a goal</param> /// <param name="getSuccessors">returns possible movements from the passed node</param> /// <param name="estimate">estimates the remaining path to the goal</param> /// <param name="callback">fires when calculation is done</param> public void CalculateCustomPathAsync(Vector3I start, Predicate <AStarNodeFunc3D> isGoal, Action <AStarNodeFunc3D, List <AStarNodeFunc3D> > getSuccessors, Func <AStarNodeFunc3D, double> estimate, PathCalculatedDeleagte callback) { var d = new CalculateCustomPathDelegate(CalculateCustomPath); d.BeginInvoke(start, isGoal, getSuccessors, estimate, CustomPathCalculated, callback); }
/// <summary> /// Calculates path asynchronously and fires callback when done /// </summary> /// <param name="start"></param> /// <param name="goal"></param> /// <param name="callback"></param> public void CalculatePathAsync(Vector3I start, Vector3I goal, PathCalculatedDeleagte callback) { var d = new CalculatePathDelegate(CalculatePath); d.BeginInvoke(start, goal, PathCalculated, callback); }