PlantPanel.ts 756 B

1234567891011121314151617181920212223242526272829
  1. /** 可生产产品列表 */
  2. import TableView from "../../../game/component/TableView";
  3. const { ccclass, property } = cc._decorator;
  4. @ccclass
  5. export default class PlantPanel extends cc.Component {
  6. @property({ type: TableView, displayName: '滚动视图' })
  7. private tableView: TableView = null!;
  8. start() {
  9. this.initScollView();
  10. }
  11. /**
  12. * 初始化滚动视图
  13. */
  14. private initScollView() {
  15. let list_data = gData.plantData.productArr;
  16. this.tableView.node.emit('srollview-init', list_data)
  17. // let index = gData.sign.getItemIndexByCanSign();
  18. // if (index > 0)
  19. // index -= 1;
  20. // this.tableView.contentMoveByIndex(index, 0.1);
  21. }
  22. }