nol1fe / delaunator-sharp

Fast Delaunay triangulation of 2D points implemented in C#.
MIT License
418 stars 54 forks source link

After importing into unity #10

Closed YouriOkkerse closed 3 years ago

YouriOkkerse commented 3 years ago

Library\PackageCache\com.nol1fe.delaunator@d542c6bf57\Runtime\Scripts\UniformPoissionDiskSampler.cs(176,30): error CS0723: Cannot declare a variable of static type 'Random'

TylerKostuch commented 3 years ago

After upgrading to Unity 2020.20f1, I am seeing this error as well.

YouriOkkerse commented 3 years ago

I believe you can leave out the entire line and the error is resolved. Since I have been working on so many different projects the past days I can't perfectly recall but I believe the line was unused. Furthermore a really nice package.

TylerKostuch commented 3 years ago

Yeah, looking at the code, I'm not sure why Random was an instance in the first place.

As this documentation outlines, UnityEngine.Random is a static class in both 2019.3 and 2020.2.

Removing line 176 should not impact the other Random calls, as it will now just access the static version.

I'm going to go ahead and work with that for a while and see if any issues arise.

nol1fe commented 3 years ago

Hi,

@TylerKostuch, @YouriOkkerse you are both correct, this line should not exists over there at all. It was transfered from System.Random implementation and i've made some copy-paste error. Sorry for troubles :)

I've pushed an update and now everything seems to be alright.

Cheers

TylerKostuch commented 3 years ago

Thanks @YouriOkkerse, I hate maintain a fork so I appreciate the fast update. Everything is working perfectly.