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.
See
A* Pro Feature:
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
Inner Types
Public Methods
Calculates the grid connections for a single node.
Calculates connections for all nodes in a cell (there may be multiple layers of nodes)
Calculates the layered grid graph connections for a single node.
Number of nodes in the graph.
Returns the nearest node to a position using the specified NNConstraint.
Node in the specified cell in the first layer.
Node in the specified cell.
Calls a delegate with all nodes in the graph.
Get all nodes in a rectangle.
Get all nodes in a rectangle.
Recalculates single cell.
Public Variables
Nodes with a short distance to the node above it will be set unwalkable.
If two layered nodes are too close, they will be merged.
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.
Returns if node is connected to it's neighbour in the specified direction.
Erodes the walkable area.
Erodes the walkable area.
Returns the nearest node to a position.
Returns the nearest node to a position using the specified NNConstraint.
Returns the nearest node to a position using the specified constraint .
Neighbour direction indices to use depending on how many neighbours each node should have.
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.
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.
Returns true if a connection between the adjacent nodes n1 and n2 is valid.
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.
Draw gizmos for the graph.
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.
Scaling of the graph along the X axis.
Center point of the grid.
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.
Erosion of the graph.
Tag to start from when using tags for erosion.
Use tags instead of walkability for erosion.
In GetNearestForce, determines how far to search after a valid node has been found.
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 position difference between two nodes to enable a connection.
The max slope in degrees for a node to be walkable.
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.
How much penalty is applied depending on the slope of the terrain.
How much extra to penalize very steep angles.
Use position (y-coordinate) to calculate penalty.
Scale factor for penalty when calculating from position.
Offset for the position when calculating penalty.
Rotation of the grid in degrees.
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.
Holds settings for using a texture as source for a grid graph.
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.
This is placed here so generators inheriting from this one can override it and set it to false.
Use jump point search to speed up pathfinding.
Width of the grid in nodes.
Private/Protected Members
Increases the capacity of the nodes array to hold more layers.
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.
True if the node has any blocked connections.
All nodes inside the shape or if null, the bounding box.
This function will be called when this graph is destroyed.
Called after all deserialization has been done for all graphs.
Fires a ray from the sky and returns a sample for everything it hits.
Internal method to scan the graph.
Serializes graph type specific node data.
Updates an area using the specified #GraphUpdateObject.
Which neighbours are going to be used when neighbours=8.
Which neighbours are going to be used when neighbours=4.
Sorts RaycastHits by distance.
True if the graph exists, false if it has been destroyed.
Which neighbours are going to be used when neighbours=6.
Number of layers.
Use heigh raycasting normal for max slope calculation.
Deprecated Members
Calculates the layered grid graph connections for a single node.
Returns if node is connected to it's neighbour in the specified direction.