12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
- import UIbase from "../utils/UIbase";
- import PrefabUtil from "../utils/manager/PrefabUtil";
- import ShopSkinItem from "./ShopSkinItem";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class ShopUI extends UIbase {
- private static _inst: ShopUI;
- public static get inst() {
- if (this._inst == null) {
- let v = cc.instantiate(PrefabUtil.get("ShopUI"));
- this._inst = v.getComponent(ShopUI);
- }
- return this._inst;
- }
- @property([cc.Node])
- nodes: cc.Node[] = [];
- protected start(): void {
- }
- protected onEnable(): void {
- this.updateNodesData()
- }
- updateNodesData() {
- this.nodes.forEach(item => {
- item.getComponent(ShopSkinItem).setData()
- })
- }
- // update (dt) {}
- }
|