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

スクリプト言語

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

Editor.UseDefaultMargins

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 function UseDefaultMargins(): bool;
public bool UseDefaultMargins();
public def UseDefaultMargins() as bool

Description

デフォルトのマージンを取らせたくない場合、Editorを継承したクラスでメソッドをオーバーライドし、 false を返すようにします

By default, content in the Inspector has a large left margin and a small right margin. This is because the entire Editor.OnInspectorGUI callback is wrapped in a vertical group with the EditorStyles.inspectorDefaultMargins style. For a consistent look, these default margins should be used for most GUI with regular controls. However, some special GUI elements may benefit from occupying the full width of the Inspector, with only a small margin in both sides. To disable the default margins, override the Editor.UseDefaultMargins method in your custom Editor and make it return false. Then you can wrap your GUI content inside a vertical groups to your liking. For example, you can wrap some of the GUI inside a vertical group with the EditorStyles.inspectorFullWidthMargins style and wrap other parts of the GUI inside a vertical group with the EditorStyles.inspectorDefaultMargins style. See Also: EditorGUILayout.BeginVertical, EditorGUILayout.EndVertical, EditorStyles.inspectorDefaultMargins, EditorStyles.inspectorFullWidthMargins.