mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
1df811e6a5
# Objective - When writing "in game" debugging tools, quite often you need the name of an entity (for example an entity tree). DebugName is the usual way of doing that. - A recent change to Entity's Debug implementation meant it was no longer a minimal {index}v{generation} but instead a more verbose auto generated Debug. - This made DebugName's Debug implementation also verbose ## Solution - I changed DebugName to derive Debug automatically and added a new (preferred) Display implementation for it which is the preferred name for an entity. If the entity has a Name component its the contents of that, otherwise it is {index}v{generation} (though this does not use Display of the Entity as that is more verbose than this). ## Testing - I've added a new test in name.rs which tests the Display implementation for DebugName by using to_string. --- ## Migration Guide - In code which uses DebugName you should now use the Display implementation rather than the Debug implementation (ie {} instead of {:?} if you were printing it out). --------- Co-authored-by: John Payne <20407779+johngpayne@users.noreply.github.com> Co-authored-by: Jan Hohenheim <jan@hohenheim.ch> Co-authored-by: Andres O. Vela <andresovela@users.noreply.github.com> |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_picking | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |