feat(node): destroy method

This commit is contained in:
Nova
2022-06-08 17:28:27 -04:00
parent bb356f6cb1
commit f9f36dd43a
3 changed files with 23 additions and 2 deletions

View File

@@ -34,6 +34,10 @@ impl<'a> Scenegraph<'a> {
pub fn get_node(&self, path: &str) -> Option<RcCell<Node<'a>>> {
Some(self.nodes.read().ok()?.get(path)?.clone())
}
pub fn remove_node(&self, path: &str) -> Option<RcCell<Node<'a>>> {
self.nodes.write().unwrap().remove(path)
}
}
impl<'a> scenegraph::Scenegraph for Scenegraph<'a> {