Skip to content

Instantly share code, notes, and snippets.

@gegagome
Created July 25, 2016 00:07
Show Gist options
  • Save gegagome/585e8cdd03846239ac43a11096454af6 to your computer and use it in GitHub Desktop.
Save gegagome/585e8cdd03846239ac43a11096454af6 to your computer and use it in GitHub Desktop.
using UnityEngine;
using UnityEngine.EventSystems;
public class GraphicForLetters : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler {
void Awake () {
SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
spriteRenderer.sortingOrder = 3;
}
public void OnPointerDown(PointerEventData eventData) {
Debug.Log(eventData.pointerPress.name);
}
public void OnPointerUp(PointerEventData eventData) {
Debug.Log(eventData.pointerPress.name);
Debug.Log(".....");
}
public void OnPointerClick(PointerEventData eventData) {
Debug.Log("hhhh");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment