The question is answered, right answer was accepted
(Solved) OnPointerUp not called
I've already done the followings:
Add PhysicsRaycaster to Main Camera
Add a EventSystem in the scene (But its created with Canvas before I handling the touch, would it matter?)
Add collider for the object, and check IsTrigger
Implement IPointerUpHandler in script
Ensure no other object is on top of it
But the OnPointerUp is just not called.
Any ideas? Do i still miss something?
The OnPointerUp(PointerEventData eventData)
is called if the eventData.pointerPress
is set to the same object prior to calling OnPointerUp
. You can see my answer here
Answer by wonson · Aug 25, 2016 at 07:52 PM
Nail it. You can't implement IPointerUpHandler its own only.
You must at least also implement IPointerDownHandler, or any other handle involve a down event (such as IPointClickHandler).
I think they should write this into manual.
Hi @wonson , could you have a look at my question here: http://answers.unity3d.com/questions/1345213/how-to-useimplement-imovehandler.html I don't understand how the move event works. Thanks!