32 lines
559 B
C#
32 lines
559 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BTN_OptionsBaitIndicator : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Toggle toggle;
|
|
|
|
private PlayerSettingsMy playerSettings;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (toggle == null)
|
|
{
|
|
toggle = GetComponent<Toggle>();
|
|
}
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
playerSettings = GlobalSettings.Instance.playerSettings;
|
|
toggle.isOn = playerSettings.showBaitIndicator;
|
|
}
|
|
}
|
|
|
|
public void ValueChanged()
|
|
{
|
|
if ((bool)playerSettings)
|
|
{
|
|
playerSettings.SetBaitIndicator(toggle.isOn);
|
|
}
|
|
}
|
|
}
|