Function GridIterationUtilities.ForEachCellIn3DSlice

ForEachCellIn3DSlice<T> (Slice3D slice, ref T action)

Iterates over a slice of a 3D array.

Public Static
void ForEachCellIn3DSlice<T> (

Slice3D

slice

Bounds of the slice and the size of the outer array it is relative to.

ref T

action

Your callback struct. The Execute method on the callback struct will be called for each element in the slice. It will be passed both the index in the slice and the index in the outer array.

)

Iterates over a slice of a 3D array.

This is a helper for iterating over grid graph data, which is typically stored in an array of size width*layers*depth (x*y*z).

In burst-compiled code, this will be essentially as fast as writing the loop code yourself. In C#, it is marginally slower than writing the loop code yourself.