소스 검색

wx sound merge

xx 1 년 전
부모
커밋
e5be39b98c
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      assets/script/run/sysSound.ts
  2. 2 1
      assets/script/run/ui/sound_text_content.ts

+ 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)
     }
 }