Open
Description
What problem does this solve or what need does it fill?
There may be times where we want a Resource to store an entity where it would not make sense to do so for components.
// It wouldn't make sense for this to be a component as there can only be one.
#[derive(Resource)]
pub struct CurrentPlayer(Entity);
pub struct Player;
Currently there is no way to ensure that the entity is valid such as in the case of Component relationships.
What solution would you like?
Allow resources to be specified in relationships
#[derive(Resource)]
#[relationship_target(relationship = Player)]
pub struct CurrentPlayer(Entity);
#[derive(Component)]
#[relationship(relationship_target = CurrentPlayer)]
pub struct Player(Entity);
What alternative(s) have you considered?
Same as before but check if the entity is valid each time it is used.