Platform Dependent Compilation 多平台兼容性使用注意事项
来源:互联网 发布:填充asp表单数据 编辑:程序博客网 时间:2024/06/04 19:43
目地:
今天想修改公司重要模块兼容PC\MAC 和Android,因为涉及到硬件连接,所以以前偷懒分别做了2个项目,因为在这个项目里面需要增加一些通用的模块,UI显示。重复制作会带来麻烦。
刚好我知道Unity3D支持Platform dependent compliation。想让在Android和桌面平台使用不同的连接方式
假如我想让除了Android端外的平台执行某段代码:
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
……
#endif
然后你会发现,你U3D切换平台到Android端,这段代码依旧不会变灰色 ,以前不注意,导致导入到真机上老是不是我想要的结果。
应该这么做:
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR && !UNITY_ANDROID
……
#endif
看到上面后面加了个并且判断! 这样这段代码就会变灰色。
简单一个直观判断,就是,你要这段代码在什么平台执行,如果切换到其他平台,这段代码需要变灰色(不适用)。
- Platform Dependent Compilation 多平台兼容性使用注意事项
- Platform Dependent Compilation 多平台兼容性使用注意事项
- Platform Dependent Compilation 多平台兼容性使用注意事项
- Platform Dependent Compilation
- Platform Dependent Compilation
- unity Platform Dependent Compilation(平台依赖编译)
- Unity3d平台脚本预定义编译条件 Platform Dependent Compilation
- 【转】Unity3D Platform Dependent Compilation
- version (or platform)dependent Code
- Linux与Windows平台的一些兼容性注意事项
- 使用平台的注意事项
- JSPatch Platform平台的简单使用
- Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
- Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
- Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
- Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent
- Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
- windows平台上使用jnative注意事项
- oracle小记2-case使用
- 分享年轻的工程师如何锻炼成高手(转载)
- 浅学设计模式之单例<singleton>模式
- text/x-scriptlet类型在IE7以上浏览器不正常显示
- lyx2.0在windows上的配置
- Platform Dependent Compilation 多平台兼容性使用注意事项
- Android应用定制皮肤
- 数据库索引与并发
- Html中的textarea 的内容不居左显示问题
- DataSet导出CSV格式(ASP.NET,C#) .
- 关于php一句话免杀的分析
- 创建range分区
- 软件打包问题
- java去除数组中的重复元素