-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add init_resource_with_descriptor #15448
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
I'm making a scripting language and I would like to be able define resources from it dynamically. I can already do this with components by calling
init_component_with_descriptorwith aComponentDescriptor::<Box<dyn PartialReflect>>but there is no equivalent for resources.What solution would you like?
Add
init_component_with_descriptorComponentDescriptorComponentIdshould be returned for each callWhat alternative(s) have you considered?
I have a
Wrapper(Box<dyn PartialReflect>)and I calllet id = init_resource::<Wrapper>(); remove_resource_by_id(id)but that doesn't allow for multiple resources with the same underlying type.