点击按钮显示和隐藏图片精简方法
using UnityEngine;
using System.Collections;
public class HideOrShowImg : MonoBehaviour {
public GameObject Img;
void Start()
{
Img.SetActive(false);
}
public void HideOrShow()
{
Img.SetActive(!Img.activeSelf);
}
}
给button指定好点击事件