// C#
using UnityEngine;
using System.Collections;
public class PlatformDefines : MonoBehaviour {
void Start () {
#if UNITY_EDITOR
Debug.Log("Unity Editor");
#endif
#if UNITY_IPHONE
Debug.Log("Iphone");
#endif
#if UNITY_STANDALONE_OSX
Debug.Log("Stand Alone OSX");
#endif
#if UNITY_STANDALONE_WIN
Debug.Log("Stand Alone Windows");
#endif
}
}
上面是一个例子,详细的参数可以看 官方文档
系统的各项参数可以使用SystemInfo 这个类
该类提供了设备的模型,设备名称,设备系统等等详细参数 具体可以查看 unity圣典