Skip to content

Commit 6981492

Browse files
committed
Fix groups layout is not rebuilt on value change for serialized types
1 parent 1a5b5a7 commit 6981492

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Editor/Elements/TriPropertyCollectionBaseElement.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public abstract class TriPropertyCollectionBaseElement : TriElement
1212

1313
private Dictionary<string, TriPropertyCollectionBaseElement> _groups;
1414

15+
internal void ClearGroups()
16+
{
17+
_declarations.Clear();
18+
}
19+
1520
[PublicAPI]
1621
public void DeclareGroups([CanBeNull] Type type)
1722
{

Editor/Elements/TriReferenceElement.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public TriReferenceElement(TriProperty property, Props props = default)
2828
_props = props;
2929
_showReferencePicker = !property.TryGetAttribute(out HideReferencePickerAttribute _);
3030
_skipReferencePickerExtraLine = !_showReferencePicker && _props.inline;
31-
32-
DeclareGroups(property.ValueType);
3331
}
3432

3533
public override bool Update()
@@ -132,6 +130,9 @@ private bool GenerateChildren()
132130

133131
RemoveAllChildren();
134132

133+
ClearGroups();
134+
DeclareGroups(_property.ValueType);
135+
135136
foreach (var childProperty in _property.ChildrenProperties)
136137
{
137138
AddProperty(childProperty);

0 commit comments

Comments
 (0)