
const DWTool = require("../utils/DWTool");

cc.Class({
    extends: cc.Component,

    properties: {
       item: cc.Node,
       content: cc.Node,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {

    },

    start () {
        
    },

    update (dt) {},

    init(skillData) {
        let arr = skillData.skills1.concat(skillData.skills2);

        this.item.getComponent('SkillItem').initBuilding(skillData.awardCount);

        // this.skillData = skillData;
        // this.item.getComponent('SkillItem').init(this, skillData[0]);
        /// 循环遍历
        for(let i = 0; i < arr.length; i++) {
            let contentItem = cc.instantiate(this.item);
            this.content.addChild(contentItem);
            contentItem.active = true;
            contentItem.getComponent('SkillItem').init(arr[i]);
        }
    }
});
