When Unity3d Editor is executed, phidget open error is issued.

Supporting Visual Studio on Windows
Post Reply
dudrock
Fresh meat
Posts: 2
Joined: Thu Jan 05, 2023 8:21 pm
Contact:

When Unity3d Editor is executed, phidget open error is issued.

Post by dudrock »

I am trying to use phidget 1046_0B (Bridge 4-input) in Unity.

However, an open error occurs in the phidget control panel even when the Unity editor is open without running in the Unity editor.

Of course, even if you run Unity, an open error is issued saying that Unity is using it.
Attachments
open error.PNG
open error.PNG (23 KiB) Viewed 30239 times
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: When Unity3d Editor is executed, phidget open error is issued.

Post by Patrick »

Unity will keep the Phidget library loaded in the editor after the first run, so you need to make sure things get closed and the library gets cleaned up before exiting your program.

Have a look at the last code block here:
https://www.phidgets.com/?view=articles ... sWithUnity

-Patrick
dudrock
Fresh meat
Posts: 2
Joined: Thu Jan 05, 2023 8:21 pm
Contact:

Re: When Unity3d Editor is executed, phidget open error is issued.

Post by dudrock »

The code below is already written when the application is closed.
The important thing is that the phidget control panel does not work even if the unity editor is open, not the phidget project.

------------------------------------------------------
void OnApplicationQuit()
{
if (Application.isEditor)
Phidget.ResetLibrary();
else
Phidget.FinalizeLibrary(0);
}
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests