HarvestData.ts 866 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**收获界面数据类 */
  2. import { Data } from "../../../mk/data/Data";
  3. const { ccclass } = cc._decorator;
  4. @ccclass
  5. export default class HarvestData extends Data {
  6. configID = null;
  7. plantID = null;
  8. config = null;
  9. call = null;
  10. openPanel(configID, plantID, call) {
  11. this.configID = configID;
  12. this.plantID = plantID;
  13. this.call = call;
  14. this.config = gData.gameData.getProductMap(this.plantID);
  15. mk.ui.openPanel('game/prefab/uiPanel/HarvestPanel');
  16. }
  17. setAdData(data) {
  18. super.setAdData(data);
  19. //领取超级加倍红包
  20. this.setToEmpty();
  21. }
  22. /** 收取后变为空地 */
  23. setToEmpty() {
  24. if (this.call) {
  25. this.call();
  26. this.call = null;
  27. }
  28. mk.ui.closePanel('HarvestPanel');
  29. }
  30. }