private void InitializeAudioHash(GameTracks gameTracks) { m_bgmHash = gameTracks.BackgroundMusics.Audios.ToDictionary(x => x.Id, x => x); List <Dictionary <string, AudioData> > results = new List <Dictionary <string, AudioData> >(); foreach (var collection in gameTracks.Collections) { results.Add(collection.Audios.ToDictionary(x => x.Id, x => x)); } m_collectionsHash = results.SelectMany(x => x) .ToDictionary(x => x.Key, y => y.Value); }
public AudioController(GameTracks gameTracks) { InitializeAudioHash(gameTracks); }