Class LayerGridGraph Extends GridGraph, IUpdatableGraph
Grid Graph, supports layered worlds.
The GridGraph is great in many ways, reliable, easily configured and updatable during runtime. But it lacks support for worlds which have multiple layers, such as a building with multiple floors. That's where this graph type comes in. It supports basically the same stuff as the grid graph, but also multiple layers. It uses a bit more memory than a regular grid graph, but is otherwise equivalent.
Inspector
Determines the layout of the grid graph inspector in the Unity Editor.
Get or set if the graph should be in 2D mode.
Aligns this grid to a given tilemap or grid layout.
Width of the grid in nodes.
Depth (height) of the grid in nodes.
Size of one node in world units.
Scaling of the graph along the X axis.
Angle in degrees to use for the isometric projection.
Center point of the grid in world space.
Rotation of the grid in degrees.
Number of neighbours for each node.
If disabled, will not cut corners on obstacles.
The max y coordinate difference between two nodes to enable a connection.
Take the slope into account for maxStepHeight.
The max slope in degrees for a node to be walkable.
Number of times to erode the graph.
Use tags instead of walkability for erosion.
Use Unity 2D Physics API.
Collision testing
Toggle collision check.
Collision shape to use.
Diameter of capsule or sphere when checking for collision.
Height of capsule or length of ray when checking for collision.
Height above the ground that collision checks should be done.
Layers to be treated as obstacles.
Shows the preview for the collision testing options.
Height testing
Toggle height check.
The height to check from when checking height ('ray length' in the inspector).
Layers to be included in the height check.
Toggles thick raycast.
Make nodes unwalkable when no ground was found with the height raycast.
Rules Take a look at Grid Graph Rules for a list of available rules.
Other settings
Show the surface of the graph.
Show an outline of the grid nodes in the Unity Editor.
Show the connections between the grid nodes in the Unity Editor.
Default penalty to apply to all nodes.
The graph supports 16 layers by default, but it can be increased to 256 by enabling the ASTAR_LEVELGRIDNODE_MORE_LAYERS option in the A* Inspector → Settings → Optimizations tab.
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited.
The Pro version can be bought here
Public Methods
Number of nodes in the graph.
Node in the specified cell.
Calls a delegate with all nodes in the graph.
Get all nodes in a rectangle.
Public Variables
Nodes with a short distance to the node above it will be set unwalkable.
Inherited Public Members
Aligns this grid to a given tilemap or grid layout.
Calculates the grid connections for a cell as well as its neighbours.
Returns a new transform which transforms graph space to world space.
Converts a hexagon dimension to a node size.
Converts an internal node size to a hexagon dimension.
Scaling used for the coordinates in the Linecast methods that take normalized points using integer coordinates.
Bounding box in world space which encapsulates all nodes in the given rectangle.
Default cost of moving one node in a particular direction.
Nearest node to a position using the specified NNConstraint.
Returns the nearest node to a position using the specified NNConstraint.
Neighbour direction indices to use depending on how many neighbours each node should have.
Node in the specified cell.
Calls a delegate with all nodes in the graph until the delegate returns false.
All nodes inside the bounding box.
All nodes inside the shape.
Get all nodes in a rectangle.
A rect that contains all nodes that the bounds could touch.
Transform a point in graph space to world space.
True if the point is inside the bounding box of this graph.
True if the point is on a walkable part of the navmesh, as seen from above.
Number of layers in the graph.
Returns if there is an obstacle between from and to on the graph.
Returns if there is an obstacle between from and to on the graph.
Returns if there is an obstacle between the two nodes on the graph.
Returns if there is an obstacle between from and to on the graph.
Returns if there is an obstacle between the two nodes on the graph.
Returns if there is an obstacle between the two nodes on the graph.
Lower bound on the squared distance from the given point to the closest node in this graph.
Draw gizmos for the graph.
Recalculates node connections for all nodes in grid graph.
Recalculates node connections for all nodes in a given region of the grid.
Moves the nodes in this graph.
Relocate the grid graph using new settings.
Scan the graph.
Updates unclampedSize from width, depth and nodeSize values.
Changes the grid shape.
Set walkability for multiple nodes at once.
Captures a snapshot of a part of the graph, to allow restoring it later.
Moves the grid by a number of nodes.
Scaling of the graph along the X axis.
World bounding box for the graph.
World bounding box for the graph.
Center point of the grid in world space.
Settings on how to check for walkability and height.
If disabled, will not cut corners on obstacles.
Depth (height) of the grid in nodes.
Enable to draw gizmos in the Unity scene view.
Number of times to erode the graph.
Tag to start from when using tags for erosion.
Bitmask for which tags can be overwritten by erosion tags.
Use tags instead of walkability for erosion.
Index of the graph, used for identification purposes.
Used as an ID of the graph, considered to be unique.
Used in the editor to check if the info screen is open.
Default penalty to apply to all nodes.
Determines the layout of the grid graph inspector in the Unity Editor.
Determines how the size of each hexagon is set in the inspector.
Get or set if the graph should be in 2D mode.
Angle in degrees to use for the isometric projection.
The max slope in degrees for a node to be walkable.
The max y coordinate difference between two nodes to enable a connection.
Name of the graph.
Costs to neighbour nodes.
Index offset to get neighbour nodes.
Offsets in the X direction for neighbour nodes.
Offsets in the Z direction for neighbour nodes.
Number of neighbours for each node.
Size of one node in world units.
All nodes in this graph.
Is the graph open in the editor.
True if the graph will be included when serializing graph data.
Rotation of the grid in degrees.
Additional rules to use when scanning the grid graph.
True if the graph should be visible in the editor.
Show an outline of the grid nodes in the Unity Editor.
Show the surface of the graph.
Show the connections between the grid nodes in the Unity Editor.
Size of the grid.
Determines how the graph transforms graph space to world space.
Size of the grid.
If true, all edge costs will be set to the same value.
Width of the grid in nodes.
Private/Protected Members
Throws an exception if it is not safe to update internal graph data right now.
Clips a line segment in graph space to the graph bounds.
Magnitude of the cross product a x b.
Deserializes graph type specific node data.
Destroys all nodes in the graph.
Notifies the system that changes have been made inside these bounds.
Cleans up any unmanaged data that the graph has.
All nodes inside the shape or if null, the bounding box.
Mask based on hexagonNeighbourIndices.
Function for cleaning up references.
Called after all deserialization has been done for all graphs.
Internal method to scan the graph.
Serializes graph type specific node data.
Which neighbours are going to be used when neighbours=8.
Which neighbours are going to be used when neighbours=4.
True if the graph exists, false if it has been destroyed.
Which neighbours are going to be used when neighbours=6.
Number of layers.
Delegate which creates and returns a single instance of the node type for this graph.
Internal data for each node.
Use heigh raycasting normal for max slope calculation.