I’m trying to use GridGraph.GetNodesInRegion (IntRect rect, GridNodeBase[] buffer)
because it doesn’t generate garbage like GridGraph.GetNodesInRegion (Bounds bounds)
does.
But to convert my worldspace bounds into an IntRect
I need to call GridGraph.GetRectFromBounds (Bounds bounds)
which is marked as protected.
It seems weird to me that a method that requries an IntRect
is public whereas the method to get an IntRect
is protected.
By marking the method public I am able to solve my problem and everything seems to work as expected, but I worry that I’m missing something important that will cause a bug down the road.
Thanks!