public bool FindPath(Tile end, bool neighboursOk) { path = PathFinder.FindPath(World.current, pos, end, neighboursOk, neighboursOk); if (path != null && path.foundPath) { return(true); } else { path = null; return(false); } }
public bool FindPath(int x, int y, bool neighboursOk) { Tile end = World.current.GetTileAt(x, y); if (end == null) { return(false); } path = PathFinder.FindPath(World.current, pos, end, neighboursOk, neighboursOk); if (path != null && path.foundPath) { return(true); } else { path = null; return(false); } }