shop_qizi_page.ts 918 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { _decorator, Component, Node, Prefab, instantiate } from 'cc';
  2. import { Holder } from '../adapter/abstract/Holder';
  3. import { ContentType } from '../adapter/define/enum';
  4. import { itemData } from '../config/ItemDataConfig';
  5. import { qipan_shop_item } from './qipan_shop_item';
  6. import { qizi_shop_item } from './qizi_shop_item';
  7. const { ccclass, property } = _decorator;
  8. @ccclass('shop_qizi_page')
  9. export class shop_qizi_page extends Component {
  10. start() {
  11. }
  12. update(deltaTime: number) {
  13. }
  14. show(holder:Holder,prefab:Prefab,list:itemData[],ct:ContentType){
  15. this.node.removeAllChildren()
  16. for (let index = 0; index < list.length; index++) {
  17. const element = list[index];
  18. var item = instantiate(prefab);
  19. this.node.addChild(item)
  20. item.getComponent(qizi_shop_item).show(element,ct)
  21. }
  22. }
  23. hide(){
  24. }
  25. }