diff --git a/fyrox-graph/src/constructor.rs b/fyrox-graph/src/constructor.rs index cf7085ccf..54bd5617e 100644 --- a/fyrox-graph/src/constructor.rs +++ b/fyrox-graph/src/constructor.rs @@ -80,6 +80,8 @@ pub struct GraphNodeConstructor { /// A name of the assembly this node constructor is from. pub assembly_name: &'static str, + + pub description: &'static str, } impl GraphNodeConstructor { @@ -91,11 +93,13 @@ impl GraphNodeConstructor { Node: From, Inner: ConstructorProvider, { + let type_info = Inner::type_info(); Self { default: Arc::new(|| Node::from(Inner::default())), variants: vec![], group: "", - assembly_name: Inner::type_info().assembly_name, + assembly_name: type_info.assembly_name, + description: type_info.doc_comment, } } @@ -179,6 +183,14 @@ impl GraphNodeConstructorContainer { .map(|c| (c.default)()) } + pub fn try_get_constructor( + &self, + type_uuid: &Uuid, + ) -> Option>> { + let map = self.map.safe_lock(); + MutexGuard::try_map(map, |v| v.get_mut(type_uuid)).ok() + } + pub fn try_get_variant( &self, constructor_variant_id: &ConstructorVariantId,