Hi guys,
I wanted to try out Unity Event System, so I did the following:
- Added EventSystem in scene by click GameObject > UI > Event System
- Added a Physics Raycaster onto the Main Camera by clicking Component > Event > Physics Raycaster
- Added the following script onto the Main Camera:
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class MovementController : MonoBehaviour, IDragHandler {
#region IDragHandler implementation
void IDragHandler.OnDrag (PointerEventData eventData)
{
Debug.Log ("Drag Detected!");
throw new System.NotImplementedException ();
}
#endregion
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
But it doesn’t seem to detect any of my drag when I play. I’m not sure what I missed.
Looking forward to your help!