mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
38 lines
806 B
TypeScript
38 lines
806 B
TypeScript
import { app } from "../App";
|
|
import { API } from "../consts/API";
|
|
import { GAPI, ModeOnHookOV } from "../consts/GAPI";
|
|
import { GUI } from "../ui/UIConfig";
|
|
import BaseData from "./BaseData";
|
|
|
|
//无限模式数据类
|
|
export default class GOnHookData extends BaseData{
|
|
|
|
info:ModeOnHookOV;
|
|
|
|
async onInit() {
|
|
await this.onUpdateInfo();
|
|
console.log("GOnHookData Info",this.info);
|
|
}
|
|
|
|
//刷新数据
|
|
async onUpdateInfo(){
|
|
this.info = await GAPI.GOnHookInfo();
|
|
}
|
|
|
|
//切换地图
|
|
async setMap(mapId:number){
|
|
|
|
this.info = await GAPI.GOnHookSetMap(mapId);
|
|
app.layer.Open(GUI.Tips,{text:"切换地图成功"});
|
|
|
|
}
|
|
|
|
//下一关
|
|
async onNextLevel(){
|
|
await GAPI.GOnHookNextLevel();
|
|
await this.onUpdateInfo();
|
|
}
|
|
|
|
}
|
|
|