- Home /
Setting custom amount of space between elements in a custom inspector with EditorGUILayout ?
The attribute [Space(float x)] inside MonoBehavior classes allows for a set amount of extra space between elements in the Inspector.
EditorGUILayout has function called Space(), however it seems to have no overload to specify a specific amount of space, it just adds a default amount of space.
Is there a way to specify a specific amount of space in a custom editor script using EditorGUILayout ?
Is there a function similar to EditorGUILayout.Space() but with specific amount of space rather than the default space it adds ?
Answer by AadiLegend · Dec 28, 2021 at 04:06 PM
@CherryPicker You can pass an argument in the GUILayout.Space() function. It would look like this: GUILayout.Space(floatValue); Eg. GUILayout.Space(10f);
Your answer
Follow this Question
Related Questions
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer
Track when the value is changed and get it 0 Answers
Recreate default editor look manually without base.OnInspectorGUI [UnityEditor] 2 Answers
Custom inspector difficulties creating a Box / Group like widget 1 Answer
Custom Inspector for a List ? 2 Answers