testPanel.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * @Author: your name
  3. * @Date: 2021-09-19 12:06:21
  4. * @LastEditTime: 2021-09-20 23:09:12
  5. * @LastEditors: Please set LastEditors
  6. * @Description: In User Settings Edit
  7. * @FilePath: \zombiefood\assets\script\test\testPanel.ts
  8. */
  9. // Learn TypeScript:
  10. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  11. // Learn Attribute:
  12. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  13. // Learn life-cycle callbacks:
  14. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  15. import gameData from "../gameLogic/utrl/gameData";
  16. import { EVENT_TYPE } from "../gameLogic/utrl/gameEnum";
  17. import gameEventManager from "../gameLogic/utrl/gameEventManager";
  18. import UIHelp from "../framework/ui/UIHelp";
  19. import UIWelfareView from "../ui/uiview/Interface/UIWelfareView";
  20. import UIShopView from "../ui/uiview/Interface/UIShopView";
  21. import UIAirdropView from "../ui/uiview/Interface/UIAirdropView";
  22. const { ccclass, property } = cc._decorator;
  23. @ccclass
  24. export default class NewClass extends cc.Component {
  25. start() {
  26. }
  27. changeBulletNum() {
  28. let bulletNum = +this.node.$bullet_editBox.getComponent(cc.EditBox).string;
  29. gameData.curBulletNum = bulletNum;
  30. }
  31. addHero(){
  32. gameEventManager.emit(EVENT_TYPE.ADD_HERO);
  33. }
  34. addBOSS(){
  35. gameEventManager.emit(EVENT_TYPE.ADD_BOSS);
  36. }
  37. clickUI(){
  38. UIHelp.ShowUI(UIAirdropView);
  39. }
  40. // update (dt) {}
  41. }