protected override List <GraphNode> GetNodesInRegion(Bounds b, GraphUpdateShape shape)
{
IntRect rectFromBounds = base.GetRectFromBounds(b);
if (this.nodes == null || !rectFromBounds.IsValid() || this.nodes.Length != this.width * this.depth * this.layerCount)
{
return(ListPool <GraphNode> .Claim());
}
List <GraphNode> list = ListPool <GraphNode> .Claim(rectFromBounds.Width *rectFromBounds.Height *this.layerCount);
for (int i = 0; i < this.layerCount; i++)
{
int num = i * this.width * this.depth;
for (int j = rectFromBounds.xmin; j <= rectFromBounds.xmax; j++)
{
for (int k = rectFromBounds.ymin; k <= rectFromBounds.ymax; k++)
{
int num2 = num + k * this.width + j;
GraphNode graphNode = this.nodes[num2];
if (graphNode != null && b.Contains((Vector3)graphNode.position) && (shape == null || shape.Contains((Vector3)graphNode.position)))
{
list.Add(graphNode);
}
}
}
}
return(list);
}