E_ElecCompetition/Electrical_inspectionCompet.../Assets/Adam/Scripts/BottomController.cs

37 lines
977 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//============================================================
//支持中文文件使用UTF-8编码
//@author YangHua
//@create 20230913
//@company QianHuo
//
//@description:
//============================================================
namespace QianHuo
{
public class BottomController : MonoBehaviour
{
public Toggle[] toggles;
public GameObject[] panels;
// Use this for initialization
private void Start()
{
for (int i = 0; i < panels.Length; i++)
{
panels[i].SetActive(false);
}
for (int i = 0; i < toggles.Length; i++)
{
int index = i;
toggles[index].onValueChanged.AddListener((isOn) =>
{
panels[index].SetActive(isOn);
});
}
}
}
}