Version: 2020.1
public static RuntimePlatform platform ;

描述

返回游戏运行平台(只读)。

如果您需要执行一些与平台相关的工作,请使用此属性。

using UnityEngine;

public class ExampleClass : MonoBehaviour { void Start() { if (Application.platform == RuntimePlatform.WindowsPlayer) Debug.Log("Do something special here"); } }

另请参阅:RuntimePlatform 枚举、SystemInfo 类。

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961