Version: 5.6

Editor.UseDefaultMargins

매뉴얼로 전환
public bool UseDefaultMargins ();

설명

Override this method in subclasses to return false if you don't want default margins.

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.

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