Version: 2021.3

ChangeCheckScope

class in UnityEditor

切换到手册

描述

检查代码块中是否有任何控件被更改。

当需要检查 GUI.changed 是否在代码块中设置为 true 时, 请按如下方式将代码封装在 ChangeCheckScope 中:

using UnityEditor;

class ExampleClass { void ExampleMethod() { using (var check = new EditorGUI.ChangeCheckScope()) { // Block of code with controls // that may set GUI.changed to true

if (check.changed) { // Code to execute if GUI.changed // was set to true inside the block of code above. } } } }

另请参阅:EditorGUI.BeginChangeCheck

变量

changed如果 GUI.changed 已设置为 true,则为 true;否则为 false。

构造函数

EditorGUI.ChangeCheckScope开始一个 ChangeCheckScope。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961