1. Download first, download the address: http://download.csdn.net/detail/cumtwys/7713473, after downloading to install.
2. Throw the LibUsbDotNet.dll into the Unity3d project and start using the Libusbdotnet library.
3. According to the official copy of the example, test
Using System;
Using Libusbdotnet;
Using Libusbdotnet.descriptors;
Using Libusbdotnet.info;
Using Libusbdotnet.main;
Using Libusbdotnet.ludnmonolibusb;
Using System.Collections.ObjectModel;
Using Unityengine;
public class Showinfo:monobehaviour {public static usbdevice Myusbdevice; Use this for initialization void Start () {//Dump all devices and descriptor information to console OUTPU
T. Usbdevice.forcelibusbwinback = true;
Usbregdevicelist alldevices = usbdevice.alldevices;
Debug.Log (Alldevices.count);
foreach (Usbregistry usbregistry in alldevices) {if (Usbregistry.open (out Myusbdevice)) {
Debug.Log (MyUsbDevice.Info.ToString ()); for (int iconfig = 0; iconfig < MyUsbDevice.Configs.Count; iconfig++) {Usbconfigin
Fo configinfo = Myusbdevice.configs[iconfig];
Debug.Log (Configinfo.tostring ()); readonlycollection<usbinterfaceinfo> interfacelist = configinfo.interfaceinfolist;
for (int iinterface = 0; iinterface < Interfacelist.count; iinterface++) {
Usbinterfaceinfo interfaceinfo = Interfacelist[iinterface];
Debug.Log (Interfaceinfo.tostring ());
readonlycollection<usbendpointinfo> endpointlist = interfaceinfo.endpointinfolist;
for (int iendpoint = 0; iendpoint < Endpointlist.count; iendpoint++) { Debug.Log (Endpointlist[iendpoint].
ToString ());
}}}//free USB resources.
This is necessary for libusb-1.0 and Linux compatibility.
Usbdevice.exit ();
}//update is called once per frame void Update () {}}
4. If you find that there is an error missing libusb-1.0.dll, you need to download Libusb-1.0.dll, download the address is, https://sourceforge.net/projects/libusb/files/ libusb-1.0/libusb-1.0.19/,
Download Libusb-1.0.19-rc1-win, decompression has libusb-1.0.dll, put Libusb-1.0.dll into windows/system32 can be solved.
5. If you cannot detect the device, then you need to run Install-filter-win.exe to install the corresponding USB device.
6. It is now found that the XBox handle can be identified.