From 5f3f4903384e47135782c9b0d4135bafc034e2c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9C?= <389212263@qq.com>
Date: Wed, 16 Dec 2020 15:58:52 +0800
Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=9F=B3=E4=B9=90=E5=92=8C?=
 =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=E4=B9=9F=E5=8F=AF?=
 =?UTF-8?q?=E4=BB=A5=E5=88=87=E6=8D=A2=E8=87=B3=E4=B8=8B=E4=B8=80=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 play/assets/tmpGame/script/Scene.js | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/play/assets/tmpGame/script/Scene.js b/play/assets/tmpGame/script/Scene.js
index c93b40c..ac35e99 100644
--- a/play/assets/tmpGame/script/Scene.js
+++ b/play/assets/tmpGame/script/Scene.js
@@ -37,7 +37,6 @@ cc.Class({
 	initSceneData() {
 		this._resList = [];
 		window.GameData = {};
-		GameData.audioCount = 0;
 	},
 
 	_designSize: null,  // 设计分辨率
@@ -121,6 +120,8 @@ cc.Class({
 
 	initData() {
 		// 所有全局变量 默认都是null 
+		GameData.audioCount = 0;
+
 		let optionList = this.data.questionList[GameData.questionIndex].optionList;
 		this.optionList = [];
 		for (let i = 0; i < optionList.length; i++) {
@@ -297,40 +298,25 @@ cc.Class({
 	},
 
 	onTurnLast() {
-		if (GameData.isMoving) {
-			return;
-		}
-		if (GameData.audioCount != 0) {
-			return;
-		}
-		GameData.questionIndex--;
 		this.nodeDict.nodAnswerParent.destroyAllChildren();
 		this.nodeDict.nodQuestionParent.destroyAllChildren();
+		cc.audioEngine.stopAll();
+		GameData.questionIndex--;
 		this.initData();
 		this.playAudioQuestion();
 	},
 	onReplay() {
-		if (GameData.isMoving) {
-			return;
-		}
-		if (GameData.audioCount != 0) {
-			return;
-		}
 		this.nodeDict.nodAnswerParent.destroyAllChildren();
 		this.nodeDict.nodQuestionParent.destroyAllChildren();
+		cc.audioEngine.stopAll();
 		this.initData();
 		this.startGame();
 	},
 	onTurnNext() {
-		if (GameData.isMoving) {
-			return;
-		}
-		if (GameData.audioCount != 0) {
-			return;
-		}
-		GameData.questionIndex++;
 		this.nodeDict.nodAnswerParent.destroyAllChildren();
 		this.nodeDict.nodQuestionParent.destroyAllChildren();
+		cc.audioEngine.stopAll();
+		GameData.questionIndex++;
 		this.initData();
 		this.startGame();
 	},
-- 
2.21.0