IndieGame/client/Packages/com.unity.inputsystem@1.7.0/InputSystem/Editor/ControlPicker/InputControlPicker.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

42 lines
1.0 KiB
C#

#if UNITY_EDITOR || PACKAGE_DOCS_GENERATION
using System;
////REVIEW: should this be a PopupWindowContent?
namespace UnityEngine.InputSystem.Editor
{
/// <summary>
/// A popup that allows picking input controls graphically.
/// </summary>
public sealed class InputControlPicker : IDisposable
{
public InputControlPicker(Mode mode, Action<string> onPick, InputControlPickerState state)
{
m_State = state ?? new InputControlPickerState();
m_Dropdown = new InputControlPickerDropdown(state, onPick, mode: mode);
}
public void Show(Rect rect)
{
m_Dropdown.Show(rect);
}
public void Dispose()
{
m_Dropdown?.Dispose();
}
public InputControlPickerState state => m_State;
private readonly InputControlPickerDropdown m_Dropdown;
private readonly InputControlPickerState m_State;
public enum Mode
{
PickControl,
PickDevice,
}
}
}
#endif // UNITY_EDITOR