NativeQuadtree
NativeQuadtree copied to clipboard
Newer version of Unity (2019 LTS) throws NativeArray not allocated exception when trying to draw tree
This happens because of NativeQuadTree<T>.Draw tries to GetEnumerator from results, which does not exist. Can be simply fixed by checking if results list exist like so:
if (results.IsCreated) {
foreach (var element in results) {
texture[(int) ((element.pos.x + widthAdd) * widthMult)][(int) ((element.pos.y + heightAdd) * heightMult)] = Color.green;
}
}
That makes sense. You could create a PR for this if you like.