Skip to content

Feature request: Add/remove component buttons #9

@PROMETHIA-27

Description

@PROMETHIA-27

I think that the editor being able to manipulate the components of entities- and display all available ones- is a vital feature which is missing currently. I'd be happy to make a PR for this, I just wanted to make an issue first in case you were working on this already. The UI for it should be easy, the biggest problem I encountered was being able to iterate all the component types available. I've found out that any type that has #[reflect(Component)] on it and has been registered (both necessary for being serialized as a scene) can be accessed like this:

let reg = app.world.get_resource::<bevy::reflect::TypeRegistry>().unwrap();
for ty in reg.read().iter() {
    if let Some(_) = ty.data::<ReflectComponent>() {
        println!("{}", ty.name());
    }
}

I'd be working on new-main rather than main, since I assume main is not going to be further developed until new-main is merged into it.

Should I go ahead and make a PR for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions