Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit df64ee8

Browse files
authored
improve struct & class editor GUI
Add support to draw default GUI for user-defined struct & class.
1 parent 0f702dc commit df64ee8

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

PostProcessing/Editor/PostProcessEffectBaseEditor.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,17 @@ protected void PropertyField(SerializedParameterOverride property, GUIContent ti
148148
}
149149

150150
// Default unity field
151-
EditorGUILayout.PropertyField(property.value, title);
151+
if (property.value.hasVisibleChildren
152+
&& property.value.propertyType != SerializedPropertyType.Vector2
153+
&& property.value.propertyType != SerializedPropertyType.Vector3)
154+
{
155+
GUILayout.Space(12f);
156+
EditorGUILayout.PropertyField(property.value, title, true);
157+
}
158+
else
159+
{
160+
EditorGUILayout.PropertyField(property.value, title);
161+
}
152162
}
153163
}
154164
}

0 commit comments

Comments
 (0)