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值
-
In the Unity editor on Mac OS X.
在Mac OS X 平台的Unity 编辑器中。 -
In the player on Mac OS X.
在Mac OS X 平台的播放器中。 -
In the player on Windows.
在Windows平台的播放器中。 -
In the web player on Mac OS X.
在Mac OS X平台的web播放器中。 -
In the Dashboard widget on Mac OS X.
在Mac OS X平台的Dashboard widget(仪表板小工具)中。 -
In the web player on Windows.
在Windows平台的web播放器中。 -
In the player on Nintendo Wii.
在Nintendo Wii平台的播放器中。 -
In the Unity editor on Windows.
在Windows平台的Unity编辑器中。 -
In the player on the iPhone.
在iPhone平台的播放器中。 -
In the player on the XBOX360
在XBOX360平台的播放器中。 -
In the player on the Play Station 3
在PS3平台的播放器中。 -
In the player on Android devices.
在Android平台的播放器中。