Where did EventSystem.GetCurrentPointerData go?

I remember I was able to get last raycast info from the new eventsystem when it was in beta version. Now I can’t find how to do it. Is this functionality removed in 4.6 release?

I want this to avoid to make an additional raycast to the scene. Since EventSystem is already making a raycast via PhysicsRaycaster component, I should be able to reach its cached data without making another raycast. Right?

Can you guys remember how to do this?

–EDIT–

After some search in my SVN repository, I found this old code piece which worked very well in 4.6 beta… I was trying to simulate MouseMove events which is the same behavior that I want to achieve now :slight_smile:

I also updated the title of the question.

in Update event:

    // Simulate MouseMove event
    /*
    var PointerData = EventSystem.instance.GetCurrentPointerData().FirstOrDefault();
    if (PointerData != null && PointerData.pointerEnter == gameObject)
    {
        if (Input.mousePosition != LastMousePosition)
        {
            SendMouseMoveEvent();
            LastMousePosition = Input.mousePosition;
        }
    }
    else LastMousePosition = -Vector3.one;
    */

Now I found out that StandaloneInputModule class has GetMousePointerEventData method but it’s protected. Maybe I can inherit that class to be able to access the GetMousePointerEventData method…

–EDIT–

I solved my problem by inheriting the standalone input class.

public class CustomStandaloneInputModule : StandaloneInputModule
{
    public PointerEventData GetPointerData()
    {
        return m_PointerData[kMouseLeftId];
    }
}

Now I can attach this custom component onto EventSystem gameobject instead of standalone component and I can call GetPointerData method on it.

    var StandaloneInputModule = (CustomStandaloneInputModule)EventSystem.current.currentInputModule;
    print(StandaloneInputModule.GetPointerData().pointerEnter);

It works and I can get the gameobject which mouse pointer hovers over… :slight_smile:

I definitely would prefer that standalone input class would have GetPointerData implemented as public.