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
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;
*/