Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/EquipmentOnlyBoughtToggle.cs
2026-02-21 16:45:37 +08:00

33 lines
611 B
C#

using UnityEngine;
using UnityEngine.UI;
public class EquipmentOnlyBoughtToggle : MonoBehaviour
{
public bool onlyBought = true;
[HideInInspector]
public Toggle toggle;
private EquipmentGUI equipmentGUI;
private void OnEnable()
{
if (toggle == null)
{
toggle = GetComponent<Toggle>();
}
if (!equipmentGUI)
{
equipmentGUI = Object.FindObjectOfType<EquipmentGUI>();
}
}
public void ValueChanged()
{
if ((bool)equipmentGUI && (bool)equipmentGUI.equipmentManager && toggle.isOn && onlyBought != equipmentGUI.showOnlyBought)
{
equipmentGUI.ShowOnlyBought(onlyBought);
}
}
}