Commit 738a7fef authored by limingzhe's avatar limingzhe

fix:debug

parent da8166ba
...@@ -587,15 +587,15 @@ cc.Class({ ...@@ -587,15 +587,15 @@ cc.Class({
// if (this.isCanDraw) { if (this.isCanDraw) {
// return; return;
// } }
// this.isCanDraw = true; this.isCanDraw = true;
// delayCall(0.3, () => { delayCall(0.01, () => {
// this.isCanDraw = false; this.isCanDraw = false;
// }) })
this.debugDrawLayer.removeAllChildren(); this.debugDrawLayer.removeAllChildren();
...@@ -1243,7 +1243,8 @@ cc.Class({ ...@@ -1243,7 +1243,8 @@ cc.Class({
picNode.isRight = isRight; picNode.isRight = isRight;
picNode.playRightAnim(); // picNode.playRightAnim();
this.playRightAnim(picNode);
if (!this.isGameEnd) { if (!this.isGameEnd) {
this.checkGameEnd(); this.checkGameEnd();
...@@ -4468,6 +4469,7 @@ cc.Class({ ...@@ -4468,6 +4469,7 @@ cc.Class({
setOneAnimaSmall(data) { setOneAnimaSmall(data) {
const rate = (this.hotZoneBg.scale * this.hotZoneBg.width) / this.data.bgItem.rect.width; const rate = (this.hotZoneBg.scale * this.hotZoneBg.width) / this.data.bgItem.rect.width;
const rectNode = new cc.Node(); const rectNode = new cc.Node();
...@@ -4505,7 +4507,7 @@ cc.Class({ ...@@ -4505,7 +4507,7 @@ cc.Class({
this.hotZoneBg.addChild(animaNode); this.hotZoneBg.addChild(animaNode);
animaNode.data = data; animaNode.data = data;
animaNode.hitCount = 0;
if (data.audio_url) { if (data.audio_url) {
cc.assetManager.loadRemote(data.audio_url, (err, audioClip) => { cc.assetManager.loadRemote(data.audio_url, (err, audioClip) => {
...@@ -4548,18 +4550,19 @@ cc.Class({ ...@@ -4548,18 +4550,19 @@ cc.Class({
armatureNames.push(armatures[i].name); armatureNames.push(armatures[i].name);
} }
// console.log('armatureNames: ', armatureNames); // console.log('armatureNames: ', armatureNames);
let animationNames = [];
if (armatureNames.length > 0) { if (armatureNames.length > 0) {
let defaultArmatureName = armatureNames[0]; let defaultArmatureName = armatureNames[0];
dragonDisplay.armatureName = defaultArmatureName; dragonDisplay.armatureName = defaultArmatureName;
// let animationNames = dragonDisplay.getAnimationNames(defaultArmatureName); // let animationNames = dragonDisplay.getAnimationNames(defaultArmatureName);
let defaultArmature = armatures[0]; let defaultArmature = armatures[0];
let animations = defaultArmature.animation; let animations = defaultArmature.animation;
let animationNames = [];
for (let i = 0; i < animations.length; i++) { for (let i = 0; i < animations.length; i++) {
animationNames.push(animations[i].name); animationNames.push(animations[i].name);
} }
animaNode.animationNames = animationNames;
rectNode.addComponent(cc.Button); rectNode.addComponent(cc.Button);
rectNode.on('click', () => { rectNode.on('click', () => {
if (rectNode.isClicked) { if (rectNode.isClicked) {
...@@ -4579,15 +4582,15 @@ cc.Class({ ...@@ -4579,15 +4582,15 @@ cc.Class({
} }
}); });
animaNode.playRightAnim = () => { // animaNode.playRightAnim = () => {
animaNode.active = true; // animaNode.active = true;
if (animationNames.length > 0) { // if (animationNames.length > 0) {
dragonDisplay.playAnimation(animationNames[0], 1); // dragonDisplay.playAnimation(animationNames[0], 1);
} // }
} // }
} animaNode.dragonDisplay = dragonDisplay;
this.animaNodeArr.push(animaNode); this.animaNodeArr.push(animaNode);
}
animaNode.x = rectNode.x + rectNode.width / 2; animaNode.x = rectNode.x + rectNode.width / 2;
...@@ -4608,7 +4611,15 @@ cc.Class({ ...@@ -4608,7 +4611,15 @@ cc.Class({
}, },
playRightAnim(animaNode) {
const animationNames = animaNode.animationNames;
const dragonDisplay = animaNode.dragonDisplay;
animaNode.active = true;
if (dragonDisplay && animationNames && animationNames.length > 0) {
dragonDisplay.playAnimation(animationNames[0], 1);
}
},
setOneHotZonePic(data) { setOneHotZonePic(data) {
const rate = (this.hotZoneBg.scale * this.hotZoneBg.width) / this.data.bgItem.rect.width; const rate = (this.hotZoneBg.scale * this.hotZoneBg.width) / this.data.bgItem.rect.width;
......
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