I've tried installing the latest version of unity3d with the latest phidget-drivers today and still no luck.
Strange thing is that when running in IDE-mode (run inside the development interface) closing is not a problem. Only when running the published .exe file.
Also when i just create the 'interfaceKit' object and attach an event-handler (attachEventHandler for example) and then don't call the open method, everything closes fine.
What happens if you don't call close? It may not be necessary in your case - you really only need to worry about it if you want to close and then open multiple times in one program run. The Phidgets will be released when the program exits. Also, close is called and the handle is cleaned up in the class finalize method which gets called from garbage collection.
When running the simpified version (just connecting to the phidget) in the unity3D IDE, it closes fine and connects fine the following times.
Just when i publish the unity3D and then run it, i can't close it without hanging.
If i don't register any event-handlers it still hangs.
The phidget interfaceKit object is a owned by a MonoBehaviour object in Unity (scripting in unity3d is handled in Mono).
How about killing the process like the following method in C#:
void KillMe()
{
string proc=Process.GetCurrentProcess().ProcessName;
Process[] processes=Process.GetProcessesByName(proc);
for(int i=0;i<processes.Length;i++)
{
processes.Kill();
}
}
Just got my phidgets Interfacekit 8/8/8 to work with sonar sensors in Unity and find I have exactly the same problem.
Everything works flawlessly with the hardware and Unity, except that once you have simply 'opened' a connection to the interface any subsequent attempt to quit Unity or built applications will cause them to hang indefinitely.
What will it take to get this resolved?
Very disappointed that an almost 2 year old thread about this bug has never been addressed with a solution.
I'm very fearful that phidgets will blame Unity and Unity will blame Phidgets with the end result that nothing will ever be resolved and thus making phidgets useless for use with Unity.
I'm more than willing to help in trying to debug this, but with the phidgets .NET dll being closed source and Unity likewise it will be very difficult to get debug information.
I did activate phidgets verbose logging, but it doesn't show any particular problems.