using UnityEngine; using System; using TMPro; using WindowsInput.Native; public class ButtonSettingManager : MonoBehaviour { public ButtonType buttonType; private PanelButton panelButton; void Start() { panelButton = GetComponent(); var widget = ConfigManager.GetConfigPanelWidget(Enum.GetName(typeof(ButtonType), buttonType)); var dropdown = widget.GetComponent(); dropdown.onValueChanged.AddListener((int value) => { panelButton.key = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(value); }); dropdown.onValueChanged?.Invoke(dropdown.value); } public enum ButtonType { TestKeyBind = 0, ServiceKeyBind = 1, CoinKeyBind = 2, CustomKeyBind = 3, } }