mirror of
https://github.com/bevyengine/bevy
synced 2024-09-20 22:42:08 +00:00
88700f3595
# Objective Make toggling the visibility of an entity slightly more convenient. ## Solution Add a mutating `toggle` method to the `Visibility` component ```rust fn my_system(mut query: Query<&mut Visibility, With<SomeMarker>>) { let mut visibility = query.single_mut(); // before: visibility.is_visible = !visibility.is_visible; // after: visibility.toggle(); } ``` ## Changelog ### Added - Added a mutating `toggle` method to the `Visibility` component |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |