} // end PlaySoundOnceForPath public void PlaySoundCacheForPath(string name, string path) { if (string.IsNullOrEmpty(name)) { return; } // end if AudioClip clip; if (false == clipCache.TryGetValue(name, out clip)) { clip = ResourcesTool.LoadAudioClip(path); if (null == clip) { return; } // end if clipCache[name] = clip; } // end if if (null == clip) { return; } // end if audio.PlayOneShot(clip, valume); } // end PlaySoundCacheForPath
} // end PlaySound public void PlayBackgroundMusic(string name) { musicAudio.clip = ResourcesTool.LoadAudioClip(name); musicAudio.Play(); } // end PlayBackgroundMusic
} // end MainAudio public void PlaySound(string name) { soundAduio.PlayOneShot(ResourcesTool.LoadAudioClip(name)); } // end PlaySound