Files
Ultimate-Fishing-Simulator-…/Assets/Scripts/Assembly-CSharp/ShowContent.cs
2026-03-04 09:37:33 +08:00

52 lines
844 B
C#

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ShowContent : MonoBehaviour
{
public Toggle toggle;
public Image toggle_image;
public Sprite image_on;
public Sprite image_off;
public List<Element> Objects = new List<Element>();
private void Start()
{
toggle.onValueChanged.AddListener(OnToggleValueChanged);
}
private void OnToggleValueChanged(bool value)
{
if (value)
{
toggle_image.sprite = image_off;
{
foreach (Element @object in Objects)
{
if (@object.ShowElement)
{
@object.gameObject.SetActive(value: true);
}
}
return;
}
}
toggle_image.sprite = image_on;
foreach (Element object2 in Objects)
{
if (object2.ShowElement)
{
object2.gameObject.SetActive(value: false);
}
}
}
private void Update()
{
}
}