Version: 2020.2
public static bool isPaused ;

描述

编辑器当前是否已暂停?

允许您以编程方式更改暂停状态,例如按下主工具栏中的 Pause 按钮。

另请参阅:isPlaying

// Simple editor Script that confirms the running
// game is paused.

using UnityEditor; using UnityEngine;

public class isPausedExample { [MenuItem("Examples/Scene paused in play mode")] static void EditorPlaying() { if (EditorApplication.isPaused) { Debug.Log("Paused"); } } }