public AudioSource GetLoadedAudioSource(BundleDataObject bundleDataObject) { if (this.loadedSources == null || !this.loadedSources.ContainsKey(bundleDataObject.AssetName)) { return(null); } return(this.loadedSources[bundleDataObject.AssetName]); }
private void AddLoadedBundle(BundleDataObject bundleDataObject, AudioSource source) { if (this.loadedSources == null) { this.loadedSources = new Dictionary <string, AudioSource>(); } if (!this.loadedSources.ContainsKey(bundleDataObject.AssetName)) { this.loadedSources.Add(bundleDataObject.AssetName, source); } }
private AudioSource GetAudioSource(BundleDataObject bundleDataObject) { GameObject gameObject = bundleDataObject.LoadValue <GameObject>(); if (gameObject != null) { AudioSource component = gameObject.GetComponent <AudioSource>(); this.AddLoadedBundle(bundleDataObject, component); return(component); } return(null); }