public void recalculatePath(ref AStarPathing pathing, Vector2 pos) { pathing = new AStarPathing(grid.getTileLocation(pos), grid.getTileLocation(positionScaled), grid); pathing.path.Clear(); pathing.findPath(); pathing.path.Insert(0, grid.getTileLocation(pos)); pathing.path.RemoveAt(pathing.path.Count - 1); }
public override BehaviorReturnCode Behave() { if (pathFound()) { return(BehaviorReturnCode.Success); } if (pathFailed()) { return(BehaviorReturnCode.Failure); } f_Pathing.findPath(); return(BehaviorReturnCode.Running); }