RuntimePlatform 运行平台

Enumeration

The platform application is running. Returned by Application.platform.

应用程序运行的平台,由Application.platform返回。

Note: The difference between using RuntimePlatform and Platform dependent Compilation is that using RuntimePlatform is evaluated at runtime while Platform dependent Compilation is evaluated at compile time. So if you can use platform dependent compilation, dont hestiate in using it. For most cases, you can get the same functionality using both, and using the defines will produce smaller and faster code, as you don't need to check at runtime. There are some cases where RuntimePlatform is needed, for example: if you need to check which platform you are running a webplayer you may check this at runtime.

注意:使用RuntimePlatform和Platform两者是不同的,取决于编译是使用RuntimePlatform在运行时判断的,还是Platform取决于编译在编译时判断的。因此如果可以使用platform取决于编译,不要犹豫使用它。大多数情况下,可以使用这两种获得相同的功能,使用定义将产生更小和更快代码,因为你不需要在运行时检查。有些情况下必须使用RuntimePlatform,例如,如果需要检查那个平台运行webplayer,这个可以在运行时检查 。

Values

最后修改:2011年7月18日 Monday 11:25

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。