bevyengine / bevyengine/bevy

AssetServer load docs should state that assets don't get loaded multiple times

Open Beginner friendly
#13,823 0 comments 0 reactions 0 assignees View on GitHub
A-Assets C-Docs D-Straightforward
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## How can Bevy's documentation be improved?

http://dev-docs.bevyengine.org/bevy/asset/struct.AssetServer.html#method.load

When doing a pattern such as in `many_foxes.rs`:

```rust
let animation_clips = [
asset_server.load(GltfAssetLabel::Animation(2).from_asset("models/animated/Fox.glb")),
asset_server.load(GltfAssetLabel::Animation(1).from_asset("models/animated/Fox.glb")),
asset_server.load(GltfAssetLabel::Animation(0).from_asset("models/animated/Fox.glb")),
];
```

I feel quite sure that reading the fox file from disk happens once and not three times.
To be very sure I checked docs, but they don't explicitly state this behavior.

So I'd like docs to clear up:

- When calling load on the same path several times, how many times is the asset loaded from disk
- When calling load on the same path several times with different labels (`#this-type-of-label`), will this still only load once from disk

Contributor guide

Open the contributing guide

Research direction

Start at the AssetServer::load documentation linked in the issue and compare its wording with the many_foxes.rs example. Confirm how repeated paths and differently labelled assets are handled, then update the documentation to state the observed loading behavior clearly and verify the generated API docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.