Esempio n. 1
0
 public void OnToolbarGUI()
 {
     if (GUILayout.Button(s_HIDDescriptor, EditorStyles.toolbarButton))
     {
         HIDDescriptorWindow.CreateOrShowExisting(this);
     }
 }
Esempio n. 2
0
        public static void OnToolbarGUI(InputDevice device)
        {
            var hid = device as HID;

            if (hid == null)
            {
                return;
            }

            if (GUILayout.Button(s_HIDDescriptor, EditorStyles.toolbarButton))
            {
                HIDDescriptorWindow.CreateOrShowExisting(hid);
            }
        }
        /// <summary>
        /// Add support for generic HIDs to InputSystem.
        /// </summary>
        public static void Initialize()
        {
            InputSystem.RegisterLayout <HID>();
            InputSystem.onFindLayoutForDevice += HID.OnFindLayoutForDevice;

            // Add toolbar button to any devices using the "HID" interface. Opens
            // a windows to browse the HID descriptor of the device.
            #if UNITY_EDITOR
            InputDeviceDebuggerWindow.onToolbarGUI +=
                device =>
            {
                if (device.description.interfaceName == HID.kHIDInterface)
                {
                    if (GUILayout.Button(s_HIDDescriptor, EditorStyles.toolbarButton))
                    {
                        HIDDescriptorWindow.CreateOrShowExisting(device.id, device.description);
                    }
                }
            };
            #endif
        }