30 lines
792 B
C#
30 lines
792 B
C#
using UnityEngine;
|
|
using System;
|
|
using TMPro;
|
|
using WindowsInput.Native;
|
|
|
|
public class ButtonSettingManager : MonoBehaviour
|
|
{
|
|
public ButtonType buttonType;
|
|
private PanelButton panelButton;
|
|
void Start()
|
|
{
|
|
panelButton = GetComponent<PanelButton>();
|
|
var widget = ConfigManager.GetConfigPanelWidget(Enum.GetName(typeof(ButtonType), buttonType));
|
|
var dropdown = widget.GetComponent<TMP_Dropdown>();
|
|
dropdown.onValueChanged.AddListener((int value) => {
|
|
panelButton.key = (VirtualKeyCode)Enum.GetValues(typeof(VirtualKeyCode)).GetValue(value);
|
|
});
|
|
dropdown.onValueChanged?.Invoke(dropdown.value);
|
|
}
|
|
|
|
public enum ButtonType
|
|
{
|
|
Test = 0,
|
|
Service = 1,
|
|
Coin = 2,
|
|
Custom = 3,
|
|
}
|
|
|
|
}
|