using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using AX.MessageSystem; [RequireComponent(typeof(Toggle))] public class DeviceMenuToggle : MonoBehaviour { public DeviceType menuType; private Toggle M_toggle; void Start() { M_toggle = GetComponent(); M_toggle.onValueChanged.AddListener(M_toggle_ValueChanged); } private void M_toggle_ValueChanged(bool isOn) { if (isOn) { DevicePanelManager.Instance.ShowBindList(menuType); } else { DevicePanelManager.Instance.ShowBindList(DeviceType.çİş); } MessageDispatcher.SendMessage("DeviceMenuChanged", new KeyValuePair(menuType, isOn)); } }