add despawn method to EntityWithGraphics

This commit is contained in:
rezural
2021-07-06 07:38:30 +10:00
committed by Sébastien Crozet
parent 0e1215e4ed
commit 9f8d9769f8

View File

@@ -104,6 +104,10 @@ impl EntityWithGraphics {
}
}
pub fn despawn(&mut self, commands: &mut Commands) {
//FIXME: Should this be despawn_recursive?
commands.entity(self.entity).despawn();
}
pub fn select(&mut self, materials: &mut Assets<StandardMaterial>) {
// NOTE: we don't just call `self.set_color` because that would
// overwrite self.base_color too.