shop_huobi.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { _decorator, Component, Node, Prefab, instantiate } from 'cc';
  2. import ItemDataConfig from '../config/ItemDataConfig';
  3. import { shop_huobi_page } from './shop_huobi_page';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('shop_huobi')
  6. export class shop_huobi extends Component {
  7. @property(Prefab) shopPrefab: Prefab = null
  8. @property(Prefab) itemPrefab: Prefab = null
  9. @property(Node) content:Node = null;
  10. start() {
  11. var yuanbaolist = ItemDataConfig.Instance.getShopYuanBaoList()
  12. var qihunlist = ItemDataConfig.Instance.getShopQiHunList()
  13. var tongqianlist = ItemDataConfig.Instance.getShopTongQianList()
  14. var yuanbao = instantiate(this.shopPrefab)
  15. yuanbao.getComponent(shop_huobi_page).show(this.itemPrefab,yuanbaolist)
  16. this.content.addChild(yuanbao)
  17. var qihun = instantiate(this.shopPrefab)
  18. qihun.getComponent(shop_huobi_page).show(this.itemPrefab,qihunlist)
  19. this.content.addChild(qihun)
  20. var tongqian = instantiate(this.shopPrefab)
  21. tongqian.getComponent(shop_huobi_page).show(this.itemPrefab,tongqianlist)
  22. this.content.addChild(tongqian)
  23. }
  24. update(deltaTime: number) {
  25. }
  26. }