其他分享
首页 > 其他分享> > 给Image这种UI添加点击事件

给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
}

标签:UnityEngine,Script,Image,点击,UI,IPointerClickHandler,using,MonoBehaviour,public
来源: https://www.cnblogs.com/code-fun/p/15922816.html