Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TouchscreenControlPickerLayout.cs 1.5KB

123456789101112131415161718192021222324252627282930313233343536
  1. #if UNITY_EDITOR
  2. using UnityEngine.InputSystem.Layouts;
  3. using UnityEngine.InputSystem.Utilities;
  4. namespace UnityEngine.InputSystem.Editor
  5. {
  6. internal class TouchscreenControlPickerLayout : IInputControlPickerLayout
  7. {
  8. public void AddControlItem(InputControlPickerDropdown dropdown, DeviceDropdownItem parent, ControlDropdownItem parentControl,
  9. InputControlLayout.ControlItem control, string device, string usage, bool searchable)
  10. {
  11. // for the Press control, show two variants, one for single touch presses, and another for multi-touch presses
  12. if (control.displayName == "Press")
  13. {
  14. dropdown.AddControlItem(this, parent, parentControl, new InputControlLayout.ControlItem
  15. {
  16. name = new InternedString("Press"),
  17. displayName = new InternedString("Press (Single touch)"),
  18. layout = control.layout
  19. }, device, usage, searchable);
  20. dropdown.AddControlItem(this, parent, parentControl, new InputControlLayout.ControlItem
  21. {
  22. name = new InternedString("Press"),
  23. displayName = new InternedString("Press (Multi-touch)"),
  24. layout = control.layout
  25. }, device, usage, searchable, "touch*/Press");
  26. }
  27. else
  28. {
  29. dropdown.AddControlItem(this, parent, parentControl, control, device, usage, searchable);
  30. }
  31. }
  32. }
  33. }
  34. #endif // UNITY_EDITOR