Implement menu despawner
This commit is contained in:
@@ -46,8 +46,16 @@ pub fn spawn_main_menu(mut commands: Commands) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn despawn_main_menu(mut commands: Commands) {
|
/// Despawns the main menu (which is assumed to be the top-most node)
|
||||||
warn!("->> ui.rs: despawn_main_menu() is not implemented.");
|
///
|
||||||
|
/// TODO: Add a marker component, but only in debug builds. A unit test can
|
||||||
|
/// assert this condition so I don't actually have to check it at runtime
|
||||||
|
/// on release builds.
|
||||||
|
pub fn despawn_main_menu(
|
||||||
|
mut commands: Commands,
|
||||||
|
top_node: Single<Entity, (With<Node>, Without<ChildOf>)>,
|
||||||
|
) {
|
||||||
|
commands.entity(top_node.into_inner()).despawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The basic bundle for generic buttons.
|
/// The basic bundle for generic buttons.
|
||||||
|
|||||||
Reference in New Issue
Block a user