Commit 0385b399 authored by asdf's avatar asdf

.

parent dc26b96b
...@@ -134,6 +134,12 @@ cc.Class({ ...@@ -134,6 +134,12 @@ cc.Class({
loadEnd() { loadEnd() {
GameData.questionIndex = 0; GameData.questionIndex = 0;
this.questionList = [];
let optionList = this.data.questionList[GameData.questionIndex].optionList;
for (let i = 0; i < optionList.length; i++) {
this.questionList[i] = i;
}
// this.questionList[0] = 0;
this.initData(); this.initData();
this.startGame(); this.startGame();
...@@ -147,16 +153,13 @@ cc.Class({ ...@@ -147,16 +153,13 @@ cc.Class({
initData() { initData() {
// 所有全局变量 默认都是null // 所有全局变量 默认都是null
this.questionList = [];
GameData.audioCount = 0; GameData.audioCount = 0;
this.nodeDict.nodButtons.zIndex = 6; this.nodeDict.nodButtons.zIndex = 6;
let optionList = this.data.questionList[GameData.questionIndex].optionList; let optionList = this.data.questionList[GameData.questionIndex].optionList;
this.optionList = []; this.optionList = [];
for (let i = 0; i < optionList.length; i++) { for (let i = 0; i < optionList.length; i++) {
this.optionList[i] = i; this.optionList[i] = i;
this.questionList[i] = i;
} }
// this.questionList[0] = 0;
this.initAnswer(); this.initAnswer();
this.initTitle(); this.initTitle();
this.updateBtnStatus(); this.updateBtnStatus();
...@@ -253,7 +256,6 @@ cc.Class({ ...@@ -253,7 +256,6 @@ cc.Class({
}, },
updateBtnStatus() { updateBtnStatus() {
console.log(GameData.questionIndex,this.data.questionList.length);
if (GameData.questionIndex == 0) { if (GameData.questionIndex == 0) {
this.nodeDict.btnLast.getComponent(cc.Button).interactable = false; this.nodeDict.btnLast.getComponent(cc.Button).interactable = false;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment