HonorLee 10 months ago
parent
commit
a18ae4f18d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      CrossgateToolkit/Audio.cs

+ 2 - 2
CrossgateToolkit/Audio.cs

@@ -54,7 +54,7 @@ namespace CrossgateToolkit
                         audioClip = Resources.Load<AudioClip>(path + "/" + audioName);
                         audioClip = Resources.Load<AudioClip>(path + "/" + audioName);
                         if (audioClip == null) return;
                         if (audioClip == null) return;
                         
                         
-                        dic.Add(id, audioClip);
+                        dic[id] = audioClip;
                         _playAudio(audioSource, audioClip);
                         _playAudio(audioSource, audioClip);
                     }
                     }
                     else
                     else
@@ -69,7 +69,7 @@ namespace CrossgateToolkit
                             {
                             {
                                 if (loadedAudioClip != null)
                                 if (loadedAudioClip != null)
                                 {
                                 {
-                                    dic.Add(id, loadedAudioClip);
+                                    dic[id] = loadedAudioClip;
                                     _playAudio(audioSource, loadedAudioClip);
                                     _playAudio(audioSource, loadedAudioClip);
                                 }
                                 }
                             }));
                             }));