Commit 38ee890f authored by 杨一航's avatar 杨一航

fix

parent f0414dae
...@@ -2,7 +2,6 @@ import { asyncDelay, asyncLoadDragonBoneAnime, asyncTweenBy, asyncTweenTo, onHom ...@@ -2,7 +2,6 @@ import { asyncDelay, asyncLoadDragonBoneAnime, asyncTweenBy, asyncTweenTo, onHom
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Cake from "../prefabs/Cake"; import Cake from "../prefabs/Cake";
import AudioButton from "../script/AudioButton"; import AudioButton from "../script/AudioButton";
import { defaultData } from "../script/defaultData";
import ChoseNode from "../prefabs/choseNode"; import ChoseNode from "../prefabs/choseNode";
import CakeBar from "../prefabs/CakeBar"; import CakeBar from "../prefabs/CakeBar";
import AudioBar from "../prefabs/AudioBar"; import AudioBar from "../prefabs/AudioBar";
...@@ -129,7 +128,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -129,7 +128,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
async initData() { async initData() {
// 所有全局变量 默认都是null // 所有全局变量 默认都是null
this._cantouch = true; this._cantouch = true;
this._totalQuestion = defaultData.questions.length; this._totalQuestion = this.data.questions.length;
this._wrongQuestion = 0; this._wrongQuestion = 0;
...@@ -149,7 +148,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -149,7 +148,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.cover.active = true; this.cover.active = true;
this.cakeRoot.active = false; this.cakeRoot.active = false;
this.cakePiece.active = false this.cakePiece.active = false
this.title.string = defaultData.title; this.title.string = this.data.title;
this.tvRoot.active = false; this.tvRoot.active = false;
this.candleRoot.active = false; this.candleRoot.active = false;
this.excellent.node.active = false; this.excellent.node.active = false;
...@@ -242,7 +241,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -242,7 +241,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this._txtAni = null; this._txtAni = null;
} }
this._nowData = defaultData.questions[this._questionIndex]; this._nowData = this.data.questions[this._questionIndex];
this.initNodes(this._nowData); this.initNodes(this._nowData);
// this.testDragonB(); // this.testDragonB();
...@@ -388,7 +387,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -388,7 +387,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
await asyncTweenTo(this.tvRoot, 0.5, { y: 0 }); await asyncTweenTo(this.tvRoot, 0.5, { y: 0 });
this._txtAni.getComponent(dragonBones.ArmatureDisplay).playAnimation("newAnimation", 1); this._txtAni.getComponent(dragonBones.ArmatureDisplay).playAnimation("newAnimation", 1);
this.playAudioByUrl(defaultData.guideAudio) this.playAudioByUrl(this.data.guideAudio)
this.candleRoot.x = - cc.winSize.width; this.candleRoot.x = - cc.winSize.width;
this.candleRoot.active = true; this.candleRoot.active = true;
......
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