Improvement of AssetServer::load documentation to help find a way to load from file with hash in filename
Objective
- Fixes #13192 .
- It is not possible to specify the path of the file and the subasset in it in one string slice, if there is a hash in the file name, because hash is separator between filename and subasset, so they must be separated explicitly
Solution
- Improved documentation for AssetServer::load.
@alice-i-cecile I used From<(Path, label)> because AssetServer::load uses Into<AssetPath> in arguments. If you prefer constructor there is a way (more complex, but exists) for such thing:
asset_server.load(AssetPath::from_path(Path::new("A#.ron")).with_label("Scene0"));
I proposed simplier way:
asset_server.load((Path::new("A#.ron"), "Scene0"));
I agree that documenting should be done, I could add this way of loading into AssetServer::load doc-comment.
If this is bad idea we can close this PR and parent issue, because constructor way already exists.
May be we should improve just AssetServer::load doc-comment with explicit path and label example
May be we should improve just AssetServer::load doc-comment with explicit path and label example
Great idea :) That's definitely my preference.
@alice-i-cecile Is there anything else I could do to move forward?