Application.platform 平台

static var platform : RuntimePlatform


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

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!");
Page last updated: 2011-7-20