言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

EditorGUI.BeginDisabledGroup

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function BeginDisabledGroup(disabled: bool): void;
public static void BeginDisabledGroup(bool disabled);
public static def BeginDisabledGroup(disabled as bool) as void

Parameters

disabled グループ内を操作不可にする場合はtureにします

Description

BeginDisabledGroupとEndDisabledGroupで囲んだGUIグループ内のGUI要素を操作不可にする場合に使用されます

もし複数のGUIグループが階層で入れ子になっている場合でも、一番上の階層のdisabledがtrueになった場合、全て操作不可になります。 falseの場合、有効/無効の状態はデフォルトのまま変更されません。

	canJump = EditorGUILayout.Toggle ("Can Jump", canJump);
	
	// Disable the jumping height control if canJump is false:
	EditorGUI.BeginDisabledGroup (canJump == false);
	jumpHeight = EditorGUILayout.FloatField ("Jump Height", jumpHeight);
	EditorGUI.EndDisabledGroup ();

The group cannot be used to enable controls that would otherwise be disabled to begin with. The groups can be nested and the controls within a child group will be disabled both if that child group is itself disabled or if a parent group is.