PlantData.ts 886 B

1234567891011121314151617181920212223242526272829303132333435
  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. init_lock = -1;
  13. //文字动画
  14. init_ani = false;
  15. //当前索引
  16. productIndex = -1;
  17. /**
  18. * 打开生产产品界面
  19. * @param tab 产品类型
  20. * @param configID 生产设备ID
  21. */
  22. openPanel(tab: ProductType, configID, index = -1) {
  23. this.tab = tab;
  24. this.configID = configID;
  25. this.productIndex = index;
  26. this.productArr = gData.gameData.getProductArrByType(tab);
  27. mk.ui.openPanel('game/prefab/uiPanel/PlantPanel');
  28. }
  29. }