mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Support Foldout SerializedProperty
This commit is contained in:
parent
bad2a1943a
commit
40631a2bc5
@ -8,7 +8,16 @@ namespace TriInspector.Utilities
|
||||
public static void Foldout(Rect rect, TriProperty property)
|
||||
{
|
||||
var content = property.DisplayNameContent;
|
||||
if (property.TryGetSerializedProperty(out var serializedProperty))
|
||||
{
|
||||
EditorGUI.BeginProperty(rect, content, serializedProperty);
|
||||
property.IsExpanded = EditorGUI.Foldout(rect, property.IsExpanded, content, true);
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
else
|
||||
{
|
||||
property.IsExpanded = EditorGUI.Foldout(rect, property.IsExpanded, content, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawBox(Rect position, GUIStyle style,
|
||||
|
Loading…
Reference in New Issue
Block a user