Beispiel #1
0
 public AudioSource GetLoadedAudioSource(BundleDataObject bundleDataObject)
 {
     if (this.loadedSources == null || !this.loadedSources.ContainsKey(bundleDataObject.AssetName))
     {
         return(null);
     }
     return(this.loadedSources[bundleDataObject.AssetName]);
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
    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);
    }