Can we detect Unity Remote running from our script?
Thanks in advance for your help.
Can we detect Unity Remote running from our script?
Thanks in advance for your help.
The following seems to work in Unity 5.3:
bool enabled = false;
#if UNITY_EDITOR
if (UnityEditor.EditorApplication.isRemoteConnected) {
enabled = true;
}
#endif
A combination of Application.platform and Input.touchCount should get you what you need.
Example:
if ((Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsEditor) && Input.touchCount != 0)
Debug.Log("Using Unity Remote");
Works, but keep in mind that it takes a second or two until the Remote connects to the editor. So if you are checking somewhere in Awake() it might still be false.
– Blubberfisch