文档

Unity Engine

Unity Engine

platform

Returns the platform the game is running on (Read Only).
阅读时间1 分钟最后更新于 1 天前

Definition

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.