HarvestData.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. //领取类型 0 普通领取 1 超级加倍
  11. getType = 0;
  12. init_reward = false;
  13. node_fly: cc.Node = null;
  14. openPanel(configID, plantID, call, node) {
  15. this.configID = configID;
  16. this.plantID = plantID;
  17. this.call = call;
  18. this.node_fly = node;
  19. this.config = gData.gameData.getProductMap(this.plantID);
  20. mk.ui.openPanel('game/prefab/uiPanel/HarvestPanel');
  21. }
  22. setAdData(data) {
  23. mk.console.logSingle('HarvestData addata ', this.adData);
  24. super.setAdData(data);
  25. //奖励弹窗
  26. //gData.reward.adData = gData.harvestData.adData;
  27. gData.reward.data = gData.harvestData.adData.videoRedMoney.videoRewardList;
  28. gData.reward.callback = gData.harvestData.call;
  29. let world_Pos = this.node_fly.parent.convertToWorldSpaceAR(this.node_fly.getPosition());
  30. gData.reward.getReward(world_Pos);
  31. //mk.ui.openPanel('module/reward/reward');
  32. gData.harvestData.call = null;
  33. }
  34. }