12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { LevelMgr } from "../../levelMgr";
- import player from "../player";
- import { GameLogicMgr } from "../update/logic";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class debug extends cc.Component {
- /*===========================自动绑定组件开始===========================*/
- /*自动生成*/
- @property({type:cc.Button, displayName:""})
- private $gamePlay_btn:cc.Button = null;
- /*自动生成*/
- @property({type:cc.Button, displayName:""})
- private $decLevel_btn:cc.Button = null;
- /*自动生成*/
- @property({type:cc.Button, displayName:""})
- private $addLevel_btn:cc.Button = null;
- /*自动生成*/
- @property({type:cc.Button, displayName:""})
- private $levelSkip_btn:cc.Button = null;
- /*自动生成*/
- @property({type:cc.Button, displayName:""})
- private $attck_btn:cc.Button = null;
- /*自动生成*/
- @property({type:cc.EditBox, displayName:""})
- private $level_edit:cc.EditBox = null;
- /*===========================自动绑定组件结束===========================*/
- /*===========================自动生成按钮事件开始==========================*/
- onGameplayTouchEnd(){
- GameLogicMgr.inst.switch();
- }
- onDeclevelTouchEnd(){
- LevelMgr.inst.pre();
- }
- onAddlevelTouchEnd(){
- LevelMgr.inst.next();
- }
- onLevelskipTouchEnd(){
- let str = this.$level_edit.string;
- LevelMgr.inst.skip(Number(str));
- }
- onAttckTouchEnd(){
- player.PlayerAttack = !player.PlayerAttack;
- }
- /*===========================自动生成按钮事件结束==========================*/
- protected onLoad(): void {
- this.$level_edit.string = LevelMgr.inst.getMax().toString();
- }
- }
|