public static int FindPath(int mapId, ref UdkVector from, ref UdkVector to, int senderType) { AStarPathFinder = new AStar<Cell>(Grids[mapId]); AStarPathFinder.UseWorldDistance = false; AStarPathFinder.FindBestPath(UdkInterfaceUtility.GraphAgentFromMovementType((MovementType)senderType, Grids[mapId]), Grids[mapId][(int)from.X, (int)from.Y, (int)from.Z], Grids[mapId][(int)to.X, (int)to.Y, (int)to.Z]); return AStarPathFinder.Nodes.Count; }
public static int CreateGrid(int sizeX, int sizeY, int sizeZ, ref UdkVector cellSize) { if(Grids == null) { Grids = new List<Grid3D>(); } Grids.Add(new Grid3D(sizeX, sizeY, sizeZ, new Cell3D(cellSize.X, cellSize.Y, cellSize.Z))); return Grids.Count - 1; }