-
-
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!
Description
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_descriptor with a ComponentDescriptor::<Box<dyn PartialReflect>> but there is no equivalent for resources.
What solution would you like?
Add init_component_with_descriptor
- takes in
ComponentDescriptor - a unique
ComponentIdshould be returned for each call
What alternative(s) have you considered?
I have a Wrapper(Box<dyn PartialReflect>) and I call let id = init_resource::<Wrapper>(); remove_resource_by_id(id) but that doesn't allow for multiple resources with the same underlying type.
Reactions are currently unavailable
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!