My question is how to make sure the app is running from a mobile device and not over a emulator? Unity Preprocessor can tell the difference?

My code is something like this:

#if  UNITY_IPHONE
    Debug.Log("Running on Apple Device.");
#elif UNITY_ANDROID
    Debug.Log("Running on Android Device.");
#elif UNITY_WP8
    Debug.Log("Running on WP Device.");
#else
    Debug.Log("Not running on mobile Device.");
#endif

Thanks in advance

有帮助吗?

解决方案

Unfortunately not. As the Unity3D Preprocessor documentation shows, there are only defines for the device types.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top