Programming/C# & Unity

Unity UI에 Onclick 넣기

장형이 2018. 3. 26. 01:04
using UnityEngine.EventSystems;

public class ClickAction : MonoBehaviour, IPointerClickHandler
{ 
    public void OnPointerClick(PointerEventData eventData)
    {
        // OnClick code goes here ...
    }
}

출처 : https://stackoverflow.com/questions/40567303/onclick-event-for-image-in-unity


비슷한 방법으로 다른것도 추가가능