Commit 7dc86ead authored by linzhiguo's avatar linzhiguo

+ 完成判定

+ 强制完成,测试使用
parent f350e187
...@@ -5685,8 +5685,8 @@ ...@@ -5685,8 +5685,8 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "button", "_string": "强制完成",
"_N$string": "button", "_N$string": "强制完成",
"_fontSize": 20, "_fontSize": 20,
"_lineHeight": 40, "_lineHeight": 40,
"_enableWrapText": false, "_enableWrapText": false,
......
...@@ -233,9 +233,13 @@ cc.Class({ ...@@ -233,9 +233,13 @@ cc.Class({
let ot = node.getComponent(cc.js.getClassByName('WordOption')); let ot = node.getComponent(cc.js.getClassByName('WordOption'));
ot.copyValues(selected); ot.copyValues(selected);
ot.selected(true); ot.selected(true);
kind.showCorrect(node); kind.showCorrect(node, ()=>{
if (this.tryFinish())
this.pageFinish();
});
selected.target.removeFromParent(); selected.target.removeFromParent();
selected.target = null; selected.target = null;
break; break;
} }
} }
...@@ -566,6 +570,18 @@ cc.Class({ ...@@ -566,6 +570,18 @@ cc.Class({
//this.resetData(); //this.resetData();
}, },
tryFinish(){
let item, op, len = this._move_area.childrenCount;
for(let i = 0; i < len; i++){
item = this._move_area.children[i];
op = item.getComponent(cc.js.getClassByName('WordOption'));
if (op.kind_id >= 0){
return false;
}
}
return true;
},
update (dt) { update (dt) {
if (!this._moved) if (!this._moved)
return; return;
......
...@@ -97,7 +97,7 @@ cc.Class({ ...@@ -97,7 +97,7 @@ cc.Class({
playDragonBoneAnimation(this.animate_node, 'newAnimation', 1, cb); playDragonBoneAnimation(this.animate_node, 'newAnimation', 1, cb);
}, },
showCorrect(ot){ showCorrect(ot, cb){
ot.x = 0; ot.x = 0;
ot.y = 0; ot.y = 0;
let item = ot.getComponent(cc.js.getClassByName('WordOption')); let item = ot.getComponent(cc.js.getClassByName('WordOption'));
...@@ -118,7 +118,7 @@ cc.Class({ ...@@ -118,7 +118,7 @@ cc.Class({
.call(()=>{ .call(()=>{
option.adjustPicSize(); option.adjustPicSize();
console.log(option); console.log(option);
cb && cb();
}) })
.start(); .start();
this.show_node.active = false; this.show_node.active = false;
......
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