Skip to content

Commit 20f36be

Browse files
committed
Add a migration guide.
1 parent a7ea451 commit 20f36be

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: `ReflectAsset` now uses `UntypedAssetId` instead of `UntypedHandle`.
3+
pull_requests: [19606]
4+
---
5+
6+
Previously, `ReflectAsset` methods all required having `UntypedHandle`. The only way to get an
7+
`UntypedHandle` through this API was with `ReflectAsset::add`. `ReflectAsset::ids` was not very
8+
useful in this regard.
9+
10+
Now, all methods have been changed to accept `impl Into<UntypedAssetId>`, which matches our regular
11+
`Assets<T>` API. This means you may need to change how you are calling these methods.
12+
13+
For example, if your code previously looked like:
14+
15+
```rust
16+
let my_handle: UntypedHandle;
17+
let my_asset = reflect_asset.get_mut(world, my_handle).unwrap();
18+
```
19+
20+
You can migrate it to:
21+
22+
```rust
23+
let my_handle: UntypedHandle;
24+
let my_asset = reflect_asset.get_mut(world, &my_handle).unwrap();
25+
```

0 commit comments

Comments
 (0)