Closed B-Reif closed 11 months ago
Very nice, thanks you!
It should be noted the 'add element' draft implementation is pretty inefficient. It uses egui's IdTypeMap which internally clones the element, and also clones the element itself to move the value out of state for use. If we have a better way to store this (on the InspectorUi struct? in the Bevy world?) that would be an improvement.
I think for an a feature like this it doesn't matter too much if this does some unnecessary clones. When it becomes obviously slow we can reconsider.
This PR adds support for editing reflected
Map
values. Specifically:Map
values in-placeIt should be noted the 'add element' draft implementation is pretty inefficient. It uses egui's
IdTypeMap
which internally clones the element, and also clones the element itself to move the value out of state for use. If we have a better way to store this (on theInspectorUi
struct? in the Bevy world?) that would be an improvement.