Files
game1/assets/_script/levelCount_order.js
T
tothvillar e896e2ead4 init
2026-07-09 15:04:14 +08:00

74 lines
1.9 KiB
JavaScript

cc.Class({
extends: cc.Component,
properties: {
oknum: {
default: 0,
type: null,
displayName: "成功数"
},
orderNode: {
type: cc.Node,
default: [],
displayName: "排序节点"
},
morenNode: [cc.Node],
suiyiNode: [cc.Node],
suiyiNode2: {
type: cc.Node,
default: [],
displayName: "不需要排序可以随意拖动的节点"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
}
},
start: function () {
this.finshiNmu = [];
cc.global.levelCountOrder = this;
if (this.suiyiNode) {
for (var e = 0; e < this.suiyiNode.length; e++) {
this.suiyiNode[e].canTesting = false;
}
}
if (this.suiyiNode2) {
for (var o = 0; o < this.suiyiNode2.length; o++) {
this.suiyiNode2[o].canTesting = true;
}
}
if (this.morenNode) {
for (var t = 0; t < this.morenNode.length; t++) {
this.morenNode[t].canTesting = true;
}
}
if (this.orderNode) {
for (var i = 0; i < this.orderNode.length; i++) {
this.orderNode[i].canTesting = false;
}
}
},
chengaOrder: function () {
if (this.finshiNmu.length >= this.morenNode.length) {
if (this.suiyiNode) {
for (var e = 0; e < this.suiyiNode.length; e++) {
this.suiyiNode[e].canTesting = true;
}
}
if (this.orderNode.length > 0) {
this.orderNode[0].canTesting = true;
this.orderNode.splice(0, 1);
console.log("删除后的数组::" + this.orderNode);
}
}
},
jiance: function () {
cc.global.Source.onPlayBtnEffect("ok");
console.log("走几遍" + this.finshiNmu.length);
if (this.finshiNmu.length == this.oknum) {
console.log("走几遍");
cc.global.gamewin = true;
this.eventNode_over && this.eventNode_over.switchEvent();
}
}
});