Open TheButlah opened 1 month ago
Hi @TheButlah, this unsafe code is required here, because #[derive(Bundle)]
trait requires for every field to implement a Component
trait, but PrototypeMaterialMeshBundle
have field what is a &'static str
which contain a feature name like floor
. And only when adding components to entity, this text value is changed to their component representation. I made that for simplicity of usage.
Hi @TheButlah, this unsafe code is required here, because
#[derive(Bundle)]
trait requires for every field to implement aComponent
trait, butPrototypeMaterialMeshBundle
have field what is a&'static str
which contain a feature name likefloor
. And only when adding components to entity, this text value is changed to their component representation. I made that for simplicity of usage.
What do you think of using Name
directly for these color generations? Those should be pretty much stable across runs in games, plus adds the benefit of not having to worry too much about the PrototypeMaterialMeshBundle
as a user.
@Aceeri hmm, Name
looks like a fine idea to apply that color, but still I think overriding this color by component will be useful.
And about stability, then two of them should work stable.
Hi, what is the purpose of the unsafe code here? I didn't understand why
#[derive(Bundle)]
is insufficient.