var t = require; var e = module; var i = exports; e = (this && this.__decorate) || function (t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", {value: !0}), (i.ShopContent = void 0); const s = t("ShopItem"), {property: o, ccclass: a, menu: n} = cc._decorator; t = class extends cc.Component { constructor() { super(...arguments), (this.itemPre = null), (this.content = null), (this.items = null); } setData(t) { (this.items = []), (this.datas = t); } initContent() { if (this.itemPre) for (const i of this.datas) { let t = cc.instantiate(this.itemPre); this.content.addChild(t); let e = t.getComponent(s.ShopItem); e.setData(i), this.items.push(e); } else { let i = this.content.children; for (let e = 0; e < i.length; e++) { let t = i[e].getComponent(s.ShopItem); t && (t.setData(this.datas[e]), this.items.push(t)); } } } updateUI() { for (const t of this.items) t.updateItem(); } updateTime(t) { for (const e of this.items) e.updateTime(t); } showContent() { for (const t of this.items) t.showItem(); } hideContent() { for (const t of this.items) t.hideItem(); } }; e([o(cc.Prefab)], t.prototype, "itemPre", void 0), e([o(cc.Node)], t.prototype, "content", void 0), (t = e([a, n("view/Shop/ShopContent")], t)), (i.ShopContent = t);