123456789101112131415161718192021222324252627282930313233343536 |
- cc.Class({
- extends: cc.Component,
- properties: {
- giftLayout: cc.Layout,
- giftItem: cc.Prefab
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- start () {
- },
- init(array) {
- this.array = array;
- for (let i = 0; i < array.length; ++i) {
- let gift = array[i];
- let item = cc.instantiate(this.giftItem);
- item = item.getComponent('StarGiftBagItem');
- item.configData(gift);
- this.giftLayout.node.addChild(item.node);
- }
- },
- closeNode() {
- this.node.destroy();
- }
- // update (dt) {},
- });
|