bevy-inspector-egui
bevy-inspector-egui copied to clipboard
Support immutable components
Instead of showing a component doesn't exist on an entity, it would be cool to show a read-only view of its properties (or maybe update the component through insertion)
Current behavior:
Desired behavior:
Read-only support added via https://github.com/jakobhellermann/bevy-inspector-egui/pull/261
Would we want support of editing the immutable components via insertion? Would probably only work for components that derive copy or clone. If it even is possible - would probably want to put it behind a feature flag or make it obvious when "editing" immutable in UI.
Hmm. I wouldn't implement it just because it's possible, but if you have a use case then I would be open to having that implemented.
I'm assuming usually when something is immutable, that's because locally editing it might result in an inconsistent state.
If we implement this, I'd agree that it should be visually obvious to see what you're doing but I wouldn't put it behind a feature flag.
I have implemented a simple "Clicked Mesh Inspector" for allowing me to inspect a clicked Entity, via the Component Inspector.
The problem I'm running into (since Bevy 0.16) is:
- The click can happen on the child mesh and I need to view and sometimes edit the Parent.
- Since Immutable Components, the
ChildOfdoes not allow it, unlike earlier whenParentwould reference the Parent Entity.
A few suggestions:
- Can we allow the Entity in Components refer to the actual entity and editable like before, irrespective of immutability?
- Immutable Components should still show the data, but it can be read-only.