using UnityEngine; using UnityEngine.UI; public class BTN_OptionsHookPrompt : MonoBehaviour { [HideInInspector] public Toggle toggle; private PlayerSettingsMy playerSettings; private void OnEnable() { if (toggle == null) { toggle = GetComponent(); } if ((bool)GlobalSettings.Instance) { playerSettings = GlobalSettings.Instance.playerSettings; toggle.isOn = playerSettings.showHookPrompt; } } public void ValueChanged() { if ((bool)playerSettings) { playerSettings.SetHookPrompt(toggle.isOn); } } }