Unfortunately I'm having no luck using the latest .NET 4.6 DLL with Unity 2018.3 under macOS using Mono 4.xx Equivalent. I've installed the latest drivers and tried several different .NET DLLs and I either get an instant crash or spinning beach ball of death when I call into the plugin.
Which version of the DLL are you using from .NET? I'm getting instant Unity crash as soon as I call into the DLL. Like to make sure I'm using the right one.
Here is my clean up code: private void OnDestroy() { CleanUp(); } private void CleanUp() { if (_reader == null) return; _reader.Tag -= ReaderOnTag; _reader.Close(); _reader = null; Phidget.FinalizeLibrary(0); } I use OnDestroy because it is called both when Play mode ends and on Application.Quit is ...
There is certainly an issue with the Editor not releasing the Phidget library or something after use. When I connect and test in the Editor the RFID reader via the DLL I'll get a reading off tags fine during play mode. But once I exit play mode, even with proper cleanup I will hang Unity Editor on a...
Can we trouble you for an example of best practise, code flow? For example here: https://phidgetseducation.edunext.io/courses/course-v1:phidgetseducation+104+2018_T1/courseware/f7820c1a3e8a479c86ae358b31a1bb83/67f997e3a0254f6d86d925393549d651/3?activate_block_id=block-v1%3Aphidgetseducation%2B104%2B...
The Phidget code is certainly using its own thread. Easily seen when trying call non-thread safe code within Unity Editor. So I suspect it is related to improper cleanup after use. Or not releasing the port. Or something. Ideally they need to open source the DLL. So we can at least have a go at fixi...