Pointer Up/Down Events Is this intended Behavior or a bug?

IF you create a Unity UI Object (text, button, image, doesn’t matter) Then attach the following script:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;

public class PointerTest : MonoBehaviour, IPointerDownHandler, IPointerUpHandler {


    public void OnPointerDown(PointerEventData eventData)
    {
        Debug.Log("Pointer Test: Point Down");
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        Debug.Log("Pointer Test: Point Up");
    }
}

Everything works perfectly. If you Remove IPointerUpHander, and the UpEventFunction. You will still receive Pointer Test: Point Down messages in the console.

However, if you remove the IPointerDownHander (and function) and just leave the Up Interface and function you receive no Log messages. Apparenty if you don’t handle the Down Event you won’t receive OnPointerUp events? This seems strange. I’m wondering if its a logical bug in Unity’s Event System, or intended behaviour

Confirm. Tried on 5.4.0.

@takatok - I’ve got no idea if it’s intended or not, but IIRC same was true for new Event system drag, if you don’t have IBeginDragHandler and it’s interface method, your OnEndDrag won’t work…

Yeah I’ve just had to add a emtpy OnPointerDown function to every script that I want to use OnPointerUp… Seems a little silly. I suspect its some code to prevent an object from receiving a PointerUp if it wasn’t the object the PointerDown was in. I click the mouse on the background… hold the mouse down then move it over a button and release it.

Stiill the expected behaviour is just don’t send this guy a PointerUp (or Better Implement a PointerClick event that only fires if the Up and Down clicked happened in the same object)