How to detect UnityRemote at runtime?

I’m wondering if there’s an obvious way to check whether or not UnityRemote is being used to generate touch inputs while running via the editor. I’ve got a use-case for my plugin where I need to detect this situation and provide a different touch handler at runtime.

Thanks in advance for your help! :slight_smile:

Its easy: if you get touch, then its the remote, otherwise its the mouse
the editor does not support any form of touch input in the play window

@dreamora: thanks for the suggestion!

However, unless I’m missing something obvious, doesn’t this method require the user to perform a touch before I can tell whether or not he’s using unity remote? I need to check for the presence of UnityRemote from my script’s Awake() and I cant just wait for the user to generate a touch…

If it’s just for internal use/testing, then just tell your team to touch the screen ASAP. Otherwise, yeah, you are out of luck.

(Or maybe you could alter Unity Remote source code to send a touch for you.)