xx 1 year ago
parent
commit
b3fdef5b1b
1 changed files with 2 additions and 3 deletions
  1. 2 3
      assets/script/manager/audioManager.ts

+ 2 - 3
assets/script/manager/audioManager.ts

@@ -75,10 +75,9 @@ export class audioManager extends Component {
             return
         }
         let loop:boolean = false
-        let play = (node)=>{
+        let play = (node:Node)=>{
             node.getComponent(AudioSource).stop()
-            node.getComponent(AudioSource).play()
-
+            node.getComponent(AudioSource).playOneShot(node.getComponent(AudioSource).clip,1)
             // node.getComponent(AudioSource).playOneShot(node.getComponent(AudioSource).clip,soundVolume?soundVolume:this.soundVolume)
         }
         if(this.audios_map.get(path)){