0
\$\begingroup\$

In Unity 2018.3: Imagine a GameObject with only a RectTransform component and a custom script attached to it - otherwise completely empty. Is there a way to receive input events (like IPointerClickHandler.OnPointerClick) without adding any graphical GUI components like text/image/rawimage/etc. ?

In other words: Is there a component or superclass available to receive input events without adding an unused graphical component?

Any clarifications are welcome, Thank you.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Did you try this approach? \$\endgroup\$
    – DMGregory
    Apr 11, 2019 at 17:29
  • \$\begingroup\$ That's exactly what I was looking for. Thank you! \$\endgroup\$ Apr 11, 2019 at 22:33
  • \$\begingroup\$ Feel free to write up an answer if you've solved the problem. \$\endgroup\$
    – DMGregory
    Apr 11, 2019 at 22:36

1 Answer 1

0
\$\begingroup\$

As @DMGregory pointed out, an elegant solution is to inherit a script from Graphics class, which works just perfect.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .