GameCult / Aetheria-Economy

Sci-fi ARPG made in Unity
Mozilla Public License 2.0
54 stars 9 forks source link

Reactive Collections for Properties Panel #38

Open rwvens opened 4 years ago

rwvens commented 4 years ago

Properties panel allows the addition of collections, causing it to display the contents of the collection. This introduces the problem that the underlying collection can change, causing the information in the properties panel to be outdated. One example of this is the inventory displayed when selecting an entity, which can change, for example when a miner acquires resources or a factory produces new items.

Reactive extensions has a tool for fixing this problem called Observable Collections, which can be subscribed to by the properties panel to allow it to update the view when the underlying collection changes.

rwvens commented 4 years ago

I've kinda halfway patched this by making the properties panel accept a list of functions, but this only allows the items in the list to update, not the list itself