unity各平台判断条件

来源:互联网 发布:修改软件版权 编辑:程序博客网 时间:2024/05/16 15:47

unity是跨平台的,一般都是在PC ,Andriod 和IOS用的比较多。

平台判断代码:

#if UNITY_ANDROID    Debug.Log("这里是安卓设备");#endif#if UNITY_IPHONE        Debug.Log("这里是苹果设备");#endif#if UNITY_STANDALONE_WIN        Debug.Log("我是从Windows的电脑上运行的");#endif


或者是写这种:

    if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)

{


}

0 0
原创粉丝点击