Skip to content

Commit

Permalink
Merge pull request #50 from Akeit0/fix-propertylistview
Browse files Browse the repository at this point in the history
Fix: Changes in PropertyListView are not reflected when field don't h…
  • Loading branch information
AnnulusGames authored Feb 21, 2024
2 parents b03898d + e170451 commit c08aaaf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Alchemy/Assets/Alchemy/Editor/Elements/PropertyListView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ public PropertyListView(SerializedProperty property, int depth)
var e = new AlchemyPropertyField(arrayElement, property.GetPropertyType(true), depth + 1, true);
element.Add(e);
element.Bind(arrayElement.serializedObject);
e.TrackPropertyValue(arrayElement, x =>
{
ReflectionHelper.Invoke(parentObj, events.OnItemChanged, new object[] { index, x.GetValue<object>() });
});
if (events != null) {
e.TrackPropertyValue(arrayElement, x =>
{
ReflectionHelper.Invoke(parentObj, events.OnItemChanged, new object[] { index, x.GetValue<object>() });
});
}
}
};
listView.unbindItem = (element, index) =>
{
Expand Down

2 comments on commit c08aaaf

@max-critcrew
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Akeit0 @AnnulusGames Is it possible that the class is in a non compiling state right now? I just pulled the package / checked the source and it seems possibly broken.

@Akeit0
Copy link
Contributor

@Akeit0 Akeit0 commented on c08aaaf Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right I create a new PR to solve this.
Sorry @AnnulusGames .

Please sign in to comment.