No Description
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.

InputControlPicker.cs 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #if UNITY_EDITOR || PACKAGE_DOCS_GENERATION
  2. using System;
  3. ////REVIEW: should this be a PopupWindowContent?
  4. namespace UnityEngine.InputSystem.Editor
  5. {
  6. /// <summary>
  7. /// A popup that allows picking input controls graphically.
  8. /// </summary>
  9. public sealed class InputControlPicker : IDisposable
  10. {
  11. public InputControlPicker(Mode mode, Action<string> onPick, InputControlPickerState state)
  12. {
  13. m_State = state ?? new InputControlPickerState();
  14. m_Dropdown = new InputControlPickerDropdown(state, onPick, mode: mode);
  15. }
  16. public void Show(Rect rect)
  17. {
  18. m_Dropdown.Show(rect);
  19. }
  20. public void Dispose()
  21. {
  22. m_Dropdown?.Dispose();
  23. }
  24. public InputControlPickerState state => m_State;
  25. private readonly InputControlPickerDropdown m_Dropdown;
  26. private readonly InputControlPickerState m_State;
  27. public enum Mode
  28. {
  29. PickControl,
  30. PickDevice,
  31. }
  32. }
  33. }
  34. #endif // UNITY_EDITOR