给Image这种UI添加点击事件
using UnityEngine;
using UnityEngine.EventSystems;
public class Script_05_06 : MonoBehaviour,IPointerClickHandler
{
#region IPointerClickHandler implementation
public void OnPointerClick(PointerEventData eventData)
{
Debug.LogFormat("{0} is clicked",gameObject.name);
}
#endregion
}