Вопрос

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