宏定义

#if UNITY_EDITOR
    Debug.Log("Unity Editor");

#elif UNITY_IOS
    Debug.Log("Unity iPhone");

#elif UNITY_ANDROID
    Debug.Log("Unity Android");

#else
    Debug.Log("Any other platform");
#endif

你可能感兴趣的:(宏定义)