Bevy ECS Markers

Crates.io MIT/Apache 2.0

Adds the support for marking entites and fetching them in queries

Example

View the whole example here

```rust

[derive(EntityMarker)]

enum Players { Red, Blue, }

[derive(EntityMarker)]

struct CurrentPlayer;

[derive(Component)]

struct Player(u32);

fn setup( mut commands: Commands, mut markers: MarkerMut, mut current: MarkerMut, ) { let red = commands.spawn(Player(12)).id(); markers[Players::Red] = red;

let blue = commands.spawn(Player(7)).id();
markers[Players::Blue] = blue;

*current = blue;

}

fn getredplayer(mut query: Query<&mut Player>, markers: Marker) { if let Ok(mut player) = query.get_mut(markers[Players::Red]) { player.0 = 15; } }

fn getcurrentplayer(mut query: Query<&mut Player>, current: Marker) { if let Ok(mut player) = query.get_mut(*current) { player.0 = 2; } } ```

License

at your option.