isEditor
Whether the game is running inside the Unity Editor (Read Only).
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static bool isEditor { get; }
Remarks
Returns true if the game is being run from the Unity Editor; false if run from any deployment target.
Examples
using UnityEngine;class Example : MonoBehaviour{ void Start() { if (Application.isEditor) { print("We are running this from inside of the editor!"); } }}