Version: 2017.2
Removed

Application.isWebPlayer

切换到手册
Obsolete public static bool isWebPlayer ;

描述

是否在 Web 播放器内运行?(只读)

如果从 Unity Web 播放器运行游戏,则返回 true。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { if (Application.isWebPlayer) print("We are running this from inside of the web player!"); } }

请注意,从 5.4.0 开始,已不再继续提供 WebPlayer 支持。