📜  unity 停止所有音频 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:18.092000             🧑  作者: Mango

代码示例1
// unity stop all sound by yasin
 private var allAudioSources : AudioSource[];
  
 function Awake() {
     allAudioSources = FindObjectsOfType(AudioSource) as AudioSource[];
 }
  
 function StopAllAudio() {
     for(var audioS : AudioSource in allAudioSources) {
         audioS.Stop();
     }
 }