Beispiel #1
0
 public void LoadAudio(AudioPreset.EnumToAudio audioSet, bool overrideExist = false)
 {
     if (clipDicts.ContainsKey(audioSet.Type))
     {
         if (!overrideExist)
         {
         #if UNITY_EDITOR
             Debug.LogWarningFormat("Audio '{0}' already exist", audioSet.Type);
         #endif
         }
         else
         {
             clipDicts[audioSet.Type] = audioSet;
         }
     }
     else
     {
         clipDicts.Add(audioSet.Type, audioSet);
     }
 }
Beispiel #2
0
 public void LoadAudio(AudioIDEnum ID, AudioClip clip, float volume = 1, bool overrideExist = false)
 {
     if (clipDicts.ContainsKey(ID))
     {
         if (!overrideExist)
         {
         #if UNITY_EDITOR
             Debug.LogWarningFormat("Audio '{0}' already exist", ID);
         #endif
         }
         else
         {
             clipDicts[ID] = new AudioPreset.EnumToAudio(ID, clip, volume);
         }
     }
     else
     {
         clipDicts.Add(ID, new AudioPreset.EnumToAudio(ID, clip, volume));
     }
 }