I need to when the user touches in any point of the screen the camera recieves pointer down|up events. I tried to attach BoxCollider2D to camera with script:
public class PlayerController : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public void OnPointerUp(PointerEventData eventData)
{
// Some logic
}
public void OnPointerDown(PointerEventData eventData)
{
// Some logic
}
}
but it doesn't work.
How to make it?
P.S. I don't care if it's click on GameObject or not, it doesn't matter, the most important is that the user clicked screen. BUT I need to ignore clicks on UI elements.
P.P.S I use Unity3D 2018.3.12f1.