Fix groups layout is not rebuilt on value change for serialized types

This commit is contained in:
VladV 2023-07-31 19:37:05 +04:00
parent 1a5b5a7468
commit 6981492ea7
2 changed files with 8 additions and 2 deletions

View File

@ -12,6 +12,11 @@ namespace TriInspector.Elements
private Dictionary<string, TriPropertyCollectionBaseElement> _groups;
internal void ClearGroups()
{
_declarations.Clear();
}
[PublicAPI]
public void DeclareGroups([CanBeNull] Type type)
{

View File

@ -28,8 +28,6 @@ namespace TriInspector.Elements
_props = props;
_showReferencePicker = !property.TryGetAttribute(out HideReferencePickerAttribute _);
_skipReferencePickerExtraLine = !_showReferencePicker && _props.inline;
DeclareGroups(property.ValueType);
}
public override bool Update()
@ -132,6 +130,9 @@ namespace TriInspector.Elements
RemoveAllChildren();
ClearGroups();
DeclareGroups(_property.ValueType);
foreach (var childProperty in _property.ChildrenProperties)
{
AddProperty(childProperty);