简体   繁体   English

确定是否正在使用Unity Remote?

[英]Determine if Unity Remote is being used?

Is there a way to check if Unity Remote is being used in the editor? 有没有办法检查Unity Remote是否在编辑器中使用? This doesn't seem to be working with Unity Remote 5? 似乎不适用于Unity Remote 5?

It appears that UnityRemote has a small delay before running your application, and UnityEditor.EditorApplication.isRemoteConnected is only true once it has detected that your application is successfully running on your device. 看来UnityRemote在运行您的应用程序之前有一个小延迟, UnityEditor.EditorApplication.isRemoteConnected只有在检测到您的应用程序在您的设备上成功运行后才会成立。

Initially I was checking whether a handheld device was connected in the Awake function, but because my application had not yet successfully started running on my device yet, it displayed as false. 最初我检查是否在Awake功能中连接了手持设备,但由于我的应用程序尚未成功开始在我的设备上运行,因此显示为false。

The fix was therefore to instead test for this in the Update function. 因此,修复程序将在Update函数中对此进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM