aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrezural <rezural@protonmail.com>2021-07-06 07:38:30 +1000
committerSébastien Crozet <sebastien@crozet.re>2021-07-08 10:07:42 +0200
commit9f8d9769f83c2b77d4bff6641117155c99ffd0d4 (patch)
tree71ae63ef26baf92499cfee8b4c35b09053721456
parent0e1215e4edd5dd9c0dc3afaf6a9c33e22175edc5 (diff)
downloadrapier-9f8d9769f83c2b77d4bff6641117155c99ffd0d4.tar.gz
rapier-9f8d9769f83c2b77d4bff6641117155c99ffd0d4.tar.bz2
rapier-9f8d9769f83c2b77d4bff6641117155c99ffd0d4.zip
add despawn method to EntityWithGraphics
-rw-r--r--src_testbed/objects/node.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src_testbed/objects/node.rs b/src_testbed/objects/node.rs
index a7d39fd..21dcc79 100644
--- a/src_testbed/objects/node.rs
+++ b/src_testbed/objects/node.rs
@@ -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.