Function GridIterationUtilities.GetNeighbourDataIndex

GetNeighbourDataIndex (IntBounds bounds, NativeArray<ulong> nodeConnections, bool layeredDataLayout, int dataX, int dataLayer, int dataZ, int direction)

Returns the data index for a node's neighbour in the given direction.

Public Static
? int GetNeighbourDataIndex (

IntBounds

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.

Return

Null if the node has no connection in that direction. Otherwise the data index for that node is returned.