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