Răsfoiți Sursa

wx sound merge

xx 1 an în urmă
părinte
comite
e5be39b98c

+ 1 - 1
assets/script/run/sysSound.ts

@@ -25,7 +25,7 @@ export class sysSound extends Component {
         }
     }
     public playClip (clip: AudioClip) {
-        this.getSound().stop()
+        this.getSound().clip = null;
         this.getSound().loop = false;
         this.getSound().clip = clip;
         this.getSound().play()

+ 2 - 1
assets/script/run/ui/sound_text_content.ts

@@ -48,7 +48,6 @@ export class sound_text_content extends Component {
     }
 
     onPlaySound(){
-        this.getAudioSource().stop()
         this.node.off(AudioSource.EventType.STARTED);
         this.node.off(AudioSource.EventType.ENDED);
         this.node.on(AudioSource.EventType.STARTED, this.onAudioStarted, this);
@@ -80,6 +79,8 @@ export class sound_text_content extends Component {
         this.node.off(AudioSource.EventType.STARTED);
         this.node.off(AudioSource.EventType.ENDED);
         this.node.active = false;
+        this.getAudioSource().stop()
+        this.getAudioSource().clip = null;
         ClientEvent.dispatchEvent(config.EventRun.WIDGET_FINISH,this.mWidgetId)
     }
 }