点击按钮显示和隐藏图片精简方法

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指定好点击事件

 

posted @ 2016-07-04 17:51  Fei非非  阅读(944)  评论(0编辑  收藏  举报