コード例 #1
0
 private void Draw(Vector3Int from, Vector3Int to)
 {
     ReplaceMany(_prevPath, emptyTile);
     _prevPath = GridPathfinder.FindPath(from, to, GridGeometry.Hex);
     ReplaceMany(_prevPath, highlightedTile);
     ReplaceOne(to, selectedTile);
 }
コード例 #2
0
 private GridPosition[] SafeBuildPath(GridPosition from, GridPosition to)
 {
     if (size.Contains(from) && size.Contains(to))
     {
         return(GridPathfinder.FindPath(from, to, geometry.Value, size));
     }
     else if (size.Contains(to))
     {
         return(new[] { to });
     }
     else
     {
         return(new GridPosition[] { });
     }
 }
コード例 #3
0
 public List <GridNode> FindPath(GridNode start, GridNode end)
 {
     return(GridPathfinder.FindPath(start, end));
 }
コード例 #4
0
ファイル: HexGrid.cs プロジェクト: CCSanders/hex-game
 public void FindPath(HexCell fromCell, HexCell toCell, Unit unit)
 {
     pathfinder.FindPath(fromCell, toCell, unit);
 }