Application.platform 平台
static var platform : RuntimePlatform
Description描述
Returns the platform the game is running (Read Only).
返回游戏运行的平台(只读)。
Use this property if you absolutely need to do some platform dependent work. See Also: RuntimePlatform
如果你要做一些平台相关的操作使用这个属性。
另参见: RuntimePlatform
C#
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour {void Start() {if (Application.platform == RuntimePlatform.WindowsPlayer)print("Do something special here!");}}
function Start () {if (Application.platform == RuntimePlatform.WindowsPlayer)print ("Do something special here!");}