给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
}
上一篇:P2107 小Z的AK计划 题解


下一篇:关于C#获取微信小程序openId