sweet/assets/scriptes/UIRankBattle.js
2020-08-07 20:44:32 +08:00

48 lines
1.2 KiB
JavaScript

// Learn cc.Class:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
nd_res: {
default: null,
type: cc.Node
},
nd_arr: {
default: [],
type: cc.Node
}
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start() {
// this.nd_res.active = false;
},
setUP() {
},
// update (dt) {},
showJcRank(dataarr) {
this.nd_res.active = true;
for (var i = 0; i < 3; i++) {
if (dataarr[i]) {
this.nd_arr[i].active = true;
this.nd_arr[i].getComponent('pbRank').setData(dataarr[i]);
} else {
this.nd_arr[i].active = false;
}
}
}
});