future 1 年之前
父节点
当前提交
e14dd4886e
共有 3 个文件被更改,包括 338 次插入295 次删除
  1. 325 292
      assets/scene/game.scene
  2. 9 1
      assets/script/run/top_layer.ts
  3. 4 2
      assets/script/run/ui/sound_text_content.ts

文件差异内容过多而无法显示
+ 325 - 292
assets/scene/game.scene


+ 9 - 1
assets/script/run/top_layer.ts

@@ -39,6 +39,7 @@ export class top_layer extends Component {
     }
 
     public unInit(){
+        this.soundTextContentAudioStop()
         this.sound_text_content.active = false;
         this.fail_ani_view.active = false;
         this.question_content.removeAllChildren()
@@ -50,6 +51,7 @@ export class top_layer extends Component {
         this.mTextSoundList.clear()
         this.mQuestionList.clear()
         this.mIsShowWin = false;
+        this.unscheduleAllCallbacks()
         ClientEvent.off(config.EventRun.NOTICE_EVENT,this.beActive.bind(this),this)
         ClientEvent.off(config.EventRun.ON_WIN,this.onWin.bind(this),this)
         ClientEvent.off(config.EventRun.SHOW_TIPS,this.onShowWidgetTip.bind(this),this)
@@ -110,6 +112,10 @@ export class top_layer extends Component {
         }
     }
 
+    soundTextContentAudioStop() {
+        this.sound_text_content.getComponent(sound_text_content).onAudioEnded(false)
+    }
+
     onWin(){
         if(this.mIsShowWin==false) {
             this.win.getComponent(win).show(this.onClickShare.bind(this),this.onClickNext.bind(this))
@@ -118,7 +124,9 @@ export class top_layer extends Component {
             ClientEvent.dispatchEvent(config.EventRun.WIN_LATER_AUTO_UNLOCK_NEXT_LEVEL,level_data)
 
             setTimeout(()=> {
-                SdkUtil.ttStopScreenRecording()
+                if(this.mIsShowWin) {
+                    SdkUtil.ttStopScreenRecording()
+                }
             },1500)
         }
     }

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

@@ -75,13 +75,15 @@ export class sound_text_content extends Component {
 
     }
 
-    onAudioEnded(){
+    onAudioEnded(isDispatchEvent:boolean=true){
         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)
+        if(isDispatchEvent) {
+            ClientEvent.dispatchEvent(config.EventRun.WIDGET_FINISH,this.mWidgetId)
+        }
     }
 }
 

部分文件因为文件数量过多而无法显示