bevy-inspector-egui
bevy-inspector-egui copied to clipboard
Read only fields in resources
I tried going through the crate, and even seen an older changelog entry where read_only(?) was added but I cannot figure out how to mark a field in a resource as read only.
This is what I tried to do:
#[derive(Resource, Debug, Default, Deref, DerefMut, Reflect, InspectorOptions)]
#[reflect(Resource, InspectorOptions)]
pub struct MyResource {
#[inspector(read_only)]
foo: bool,
}
To just display a field but not let it be changed from the inspector. Is this supported? I saw that InspectorPrimitive requires you to implement readonly variants of the ui too so I assumed there's some config option to mark fields as readonly.
I think that was from way back when Inspectable was a custom derive, instead of using bevy's reflect functionality.
Currently you can only display everything read-only (ui_for_reflect_readonly), not set a single field to be displayed readonly.