PlantData.ts 678 B

12345678910111213141516171819202122232425
  1. /** 可生产产品列表数据类 */
  2. import { ProductType } from "../../../game/data/GameData";
  3. const { ccclass } = cc._decorator;
  4. @ccclass
  5. export default class PlantData {
  6. tab = null;
  7. configID = -1;
  8. productArr = [];
  9. /** 刷新下一个要解锁数据 */
  10. init_itemIndex = -1;
  11. /**
  12. * 打开生产产品界面
  13. * @param tab 产品类型
  14. * @param configID 生产设备ID
  15. */
  16. openPanel(tab: ProductType, configID) {
  17. this.tab = tab;
  18. this.configID = configID;
  19. this.productArr = gData.gameData.getProductArrByType(tab);
  20. mk.ui.openPanel('game/prefab/uiPanel/PlantPanel');
  21. }
  22. }