Version: 2022.2

EditorApplication.isPlayingOrWillChangePlaymode

切换到手册
public static bool isPlayingOrWillChangePlaymode ;

描述

Whether the Editor is either currently in Play mode or about to switch to it. (Read Only)

This returns true when the Editor will switch to Play mode after it finishes some tasks. For example, after the Editor recompiles scripts.

另请参阅:isPlayingisCompiling