platform
Returns the platform the game is running on (Read Only).
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static RuntimePlatform platform { get; }
Remarks
Use this property if you need to do some platform dependent work.
using UnityEngine;public class ExampleClass : MonoBehaviour{ void Start() { if (Application.platform == RuntimePlatform.WindowsPlayer) Debug.Log("Do something special here"); }}
Additional Resources: RuntimePlatform enum, SystemInfo class.