using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class demo1 : MonoBehaviour {
private List<GameObject> _btnlist = new List<GameObject>();//同级按钮组
public Transform tf;//按钮的父对象
void Start () {
for (int i = 0; i < tf.childCount; i++)
{
GameObject tempBtn = tf.GetChild(i).gameObject;
tempBtn.GetComponent<Button>().onClick.AddListener(delegate { _onClick(tempBtn.gameObject); });
tempBtn.transform.Find("Content").gameObject.SetActive(false);
_btnlist.Add(tempBtn);
}
}
private void _onClick(GameObject go)
{
foreach (var temp