BeginChangeCheck と EndChangeCheck で囲んだ GUI グループ内の GUI 要素でなんらかの変更がなされたときにアクションを起こすために使用されます。
同じ機能として GUI.changed もありますが、これは OnGUI 関数内すべてのことを指すので、 wrap the code inside a ChangeCheckScope like this:
class ExampleClass
{
void ExampleMethod()
{
using (var check = new 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 を始めます。 |