Cross post from answers.unity3d.com as it’s been 13 hours and no moderator has approved my question yet.
(unable to convert EventSystem.current to pointerEventData - Questions & Answers - Unity Discussions)
When i try to use the following code to convert EventSystem.current to pointerEventData
PointerEventData pointer = new PointerEventData(EventSystem.current);
pointer shows as null when stepping through the code with monodevelop debugger and Debug.Log shows:
EventSystem.current however returns valid data when stepping through the code with monodevelop debugger and Debug.Log shows:
What am i missing, as i’m using pointer with:
ExecuteEvents.Execute(selectedObject,pointer,ExecuteEvents.dragHandler);
to trigger
#region IDragHandler implementation
public void OnDrag (PointerEventData eventData){
Debug.Log("Dragging: "+eventData.selectedObject.name);
}
#endregion
I’m still having no luck, with this, although i believe that the EventSystem.current isn’t automatically populating correctly.