-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Nowhere that I can find in the documentation, online tutorials, or the official examples shows how to correctly set up a resource struct for serialization/deserialization when it holds entities that need to be mapped to the new world.
The documentation for components is also in a very bad state, in regards to entity mapping, but I was able to figure it out by searching through the discord server at least. Not so for resources.
For example:
#[derive(Component, Reflect)]
#[reflect(Component)]
struct MyComponent {
#[entities]
entity: Entity
}works for components,
but the same thing does NOT work for resources
#[derive(Resource,Reflect)]
#[reflect(Resource)]
struct MyResource{
#[entities]
entity:Entity
}The compiler says : cannot find attribute `entities` in this scope `entities` is an attribute that can be used by the derive macros `Component` and `MapEntities`, you might be missing a `derive` attributer
This, which I found on discord, also doesn't work:
#[derive(Resource,MapEntities,Reflect)]
#[reflect(Resource)]
#[reflect(MapEntities)]
struct MyResource{
#[entities]
entity:Entity
}Knowing how to do this is pretty essential for my application, and I image for many other serious bevy users as well.