Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newer version of Unity (2019 LTS) throws NativeArray not allocated exception when trying to draw tree #9

Open
VergilUa opened this issue Feb 13, 2021 · 1 comment

Comments

@VergilUa
Copy link

This happens because of NativeQuadTree.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;
	}
}
@marijnz
Copy link
Owner

marijnz commented Feb 15, 2021

That makes sense. You could create a PR for this if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants