Function ambient_element::use_resource
source · pub fn use_resource<T: SupportedValue + Clone + Debug + Sync + Send + PartialEq + 'static>(
hooks: &mut Hooks<'_>,
component: Component<T>
) -> (Option<T>, Setter<T>)
Expand description
Use a resource from the ECS, and update its state if required.
If the resource does not exist, this will return None
.
The setter will add the resource if it does not exist.