-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
C-FeatureA new feature, making something new possibleA new feature, making something new possibleS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
What problem does this solve or what need does it fill?
https://bevy.org/learn/migration-guides/0-16-to-0-17/#handle-weak-has-been-replaced-by-handle-uuid
Since 0.17, Handle::Uuid
replaces Handle::Weak
.
Users using the Handle::Weak variant directly should consider replacing it with AssetId instead, accessible through Handle::id. These situations are very case-by-case migrations.
But that does not work for users doing the opposite: creating a Handle
from a Uuid
. For example when loading assets dynamically from a server with per-resource uuid. There is no elegant solution to create the Handle::Uuid
variant:
let handle = Handle::Uuid(uuid, PhantomData);
let handle = Handle::Uuid(uuid, Default::default());
What solution would you like?
let handle = Handle::from_uuid(uuid);
and/or
impl From<Uuid> for Handle {
fn from(uuid: Uuid) -> Self {
Handle::Uuid(uuid, PhantomData)
}
}
What alternative(s) have you considered?
The uuid_handle!()
but it works only for static const &str (str literals).
Additional context
None.
Metadata
Metadata
Assignees
Labels
C-FeatureA new feature, making something new possibleA new feature, making something new possibleS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled