shop_qipan_page.ts 871 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. const { ccclass, property } = _decorator;
  7. @ccclass('shop_qipan_page')
  8. export class shop_qipan_page extends Component {
  9. start() {
  10. }
  11. update(deltaTime: number) {
  12. }
  13. show(holder:Holder,prefab:Prefab,list:itemData[],ct:ContentType){
  14. this.node.removeAllChildren()
  15. for (let index = 0; index < list.length; index++) {
  16. const element = list[index];
  17. var item = instantiate(prefab);
  18. this.node.addChild(item)
  19. item.getComponent(qipan_shop_item).show(element,ct)
  20. }
  21. }
  22. hide(){
  23. }
  24. }