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
Public Variables
Number of layers in the graph.
Nodes with a short distance to the node above it will be set unwalkable.
Inherited Public Members
Calculates the grid connections for a cell as well as its neighbours.
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.
Neighbour direction indices to use depending on how many neighbours each node should have.
Number of layers in the graph.
Lower bound on the squared distance from the given point to the closest node in this graph.
Recalculates node connections for all nodes in a given region of the grid.
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.
True if the graph has been scanned and contains nodes.
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.
Mask based on hexagonNeighbourIndices.
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.