using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestEvent : MonoBehaviour { void Start () { EventTriggerListener.Get(gameObject).onBeginDrag = OnBeginDrag; EventTriggerListener.Get(gameObject).onDrag = OnDrag; EventTriggerListener.Get(gameObject).onEndDrag = OnEndDrag; } void OnBeginDrag(GameObject go, Vector2 pos) { Debug.Log("OnBeginDrag" + pos); } void OnDrag(GameObject go, Vector2 pos) { Debug.Log("OnBegin" + pos); go.transform.position = pos; } void OnEndDrag(GameObject go, Vector2 pos) { Debug.Log("OnBeginEnd" + pos); } }