isPlaying
Returns true when called in any kind of built Player, or when called in the Editor in Play mode (Read Only).
읽는 시간 1분최근 업데이트: 한 달 전
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static bool isPlaying { get; }
Remarks
In a built Player, this method always returns true.
In the Editor, it returns true if the Editor is in Play mode.
Unity might throw an exception when is accessed in the class constructor or its value is assigned to a variable.
Application.isPlayingNote: In the Editor for ScriptableObject assets, this property returns false in OnEnable. After reloading the domain, when reloading assemblies, Unity invokes OnEnable on all ScriptableObject instances. This happens before isPlaying is set to true.
Additional Resources: Application.IsPlaying, ExecuteAlways.
Examples
using UnityEngine;class Example : MonoBehaviour{ void Start() { if (Application.isPlaying) { print("In player or playmode"); } }}