bevy/crates/bevy_core/src
Aceeri 937fc039b1 Convenience method for entity naming (#7186)
# Objective
- Trying to make it easier to have a more user friendly debugging name for when you want to print out an entity.

## Solution
- Add a new `WorldQuery` struct `DebugName` to format the `Name` if the entity has one, otherwise formats the `Entity` id.
This means we can do this and get more descriptive errors without much more effort:
```rust
fn my_system(moving: Query<(DebugName, &mut Position, &Velocity)>) {
    for (name, mut position, velocity) in &mut moving {
        position += velocity; 
        if position.is_nan() {
            error!("{:?} has an invalid position state", name);
        }
    }
}
```

---

## Changelog
- Added `DebugName` world query for more human friendly debug names of entities.
2023-01-30 20:50:46 +00:00
..
lib.rs Convenience method for entity naming (#7186) 2023-01-30 20:50:46 +00:00
name.rs Convenience method for entity naming (#7186) 2023-01-30 20:50:46 +00:00
serde.rs Add serialize feature to bevy_core (#6423) 2022-10-31 21:20:57 +00:00
task_pool_options.rs Break CorePlugin into TaskPoolPlugin, TypeRegistrationPlugin, FrameCountPlugin. (#7083) 2023-01-05 11:42:35 +00:00