hot-update/assets/Bundle2/UI2.ts
andrewlu ef915a121e 增加版本信息获取工具类.
可以在项目代码中直接使用 import um = require('UpdateManager') 然后调用相关接口.
2021-02-03 21:34:58 +08:00

22 lines
595 B
TypeScript

const {ccclass, property} = cc._decorator;
//@ts-ignore
import UpdateManager = require('UpdateManager');
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
start() {
if (UpdateManager.getUpdateFlag()) {
this.label.string = UpdateManager.cur_ver_desc;
UpdateManager.resetUpdateFlag();
} else {
this.label.string = "未发现新版本,\n当前版本:" + UpdateManager.cur_ver_name;
}
console.log('>>>>>>>>>>>>>>>>>>>>>', UpdateManager.cur_ver_code);
}
}