Function GridIterationUtilities.GetNeighbourDataIndex
Returns the data index for a node's neighbour in the given direction.
? int GetNeighbourDataIndex (
bounds | Sub-rectangle of the grid graph that is being updated/scanned |
|
NativeArray<ulong> | nodeConnections | Data for all node connections |
bool | layeredDataLayout | True if this is a layered grid graph |
int | dataX | X coordinate in the data arrays for the node for which you want to get a neighbour |
int | dataLayer | Layer (Y) coordinate in the data arrays for the node for which you want to get a neighbour |
int | dataZ | Z coordinate in the data arrays for the node for which you want to get a neighbour |
int | direction | Direction to the neighbour. See GridNode.HasConnectionInDirection. |
Returns the data index for a node's neighbour in the given direction.
The bounds, nodeConnections and layeredDataLayout fields can be retrieved from the GridGraphRules.Context.data object.
Null if the node has no connection in that direction. Otherwise the data index for that node is returned.
Connection filters using the Unity Job System for example usage.