debug.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { LevelMgr } from "../../levelMgr";
  2. import player from "../player";
  3. import { GameLogicMgr } from "../update/logic";
  4. const {ccclass, property} = cc._decorator;
  5. @ccclass
  6. export default class debug extends cc.Component {
  7. /*===========================自动绑定组件开始===========================*/
  8. /*自动生成*/
  9. @property({type:cc.Button, displayName:""})
  10. private $gamePlay_btn:cc.Button = null;
  11. /*自动生成*/
  12. @property({type:cc.Button, displayName:""})
  13. private $decLevel_btn:cc.Button = null;
  14. /*自动生成*/
  15. @property({type:cc.Button, displayName:""})
  16. private $addLevel_btn:cc.Button = null;
  17. /*自动生成*/
  18. @property({type:cc.Button, displayName:""})
  19. private $levelSkip_btn:cc.Button = null;
  20. /*自动生成*/
  21. @property({type:cc.Button, displayName:""})
  22. private $attck_btn:cc.Button = null;
  23. /*自动生成*/
  24. @property({type:cc.EditBox, displayName:""})
  25. private $level_edit:cc.EditBox = null;
  26. /*===========================自动绑定组件结束===========================*/
  27. /*===========================自动生成按钮事件开始==========================*/
  28. onGameplayTouchEnd(){
  29. GameLogicMgr.inst.switch();
  30. }
  31. onDeclevelTouchEnd(){
  32. LevelMgr.inst.pre();
  33. }
  34. onAddlevelTouchEnd(){
  35. LevelMgr.inst.next();
  36. }
  37. onLevelskipTouchEnd(){
  38. let str = this.$level_edit.string;
  39. LevelMgr.inst.skip(Number(str));
  40. }
  41. onAttckTouchEnd(){
  42. player.PlayerAttack = !player.PlayerAttack;
  43. }
  44. /*===========================自动生成按钮事件结束==========================*/
  45. protected onLoad(): void {
  46. this.$level_edit.string = LevelMgr.inst.getMax().toString();
  47. }
  48. }