I struggle with the semantics of asset/config work. Is what I have going here how I should do that?
The code loads mutable states once from config and keep mutations on the resource. Or is accessing the asset directly for runtime modifications recommended?
fn apply_loaded_audio_config(
mut commands: Commands,
handle: Res<AudioConfigHandle>,
assets: Res<Assets<AudioConfig>>,
mut audio_config: ResMut<AudioConfig>,
) {
// write to audio_config on game launch
}
The implications that I can understand:
- Accessing the Res<Asset<T>> is verbose
- Making a Res copy duplicates the memory footprint
I think the bottom line of my problem is that I do not understand the semantic and functional difference of Res<Asset<T>> and Res<T>. Any help is appreciated.