[add] 熱更新

This commit is contained in:
2022-09-03 23:53:06 +08:00
parent 2bde4ac72e
commit c2cb85afe4
9 changed files with 40 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
import { CoroutineV2 } from "../Engine/CatanEngine/CoroutineV2/CoroutineV2";
import UpdatePanel from "../UpdatePanel";
import BusinessTypeSetting from "../_BusinessTypeSetting/BusinessTypeSetting";
import Enum_HUDM from "./Enum_HUDM";
const { ccclass, property } = cc._decorator;
@@ -44,17 +45,13 @@ export default class HUDM extends cc.Component {
}
HUDM._instance = this;
this._updatePanel = params[0];
// let packageUrl: string = params[1];
// let BundleData: Enum_Loading.BundleDataObj = AssetBundleMamager.Instance.RemoteVerList[this.BundleName];
// let packageUrl: string = BundleData.BundleUrl;
let packageUrl: string = `https://jianmiau.tk/Resources/App/JMKA/update/remote-assets`;
let packageUrl: string = `https://jianmiau.tk/Resources/App/JMKA/update/remote-assets/${BusinessTypeSetting.COMPILE_VERSION}`;
this._customManifest = JSON.stringify({
"packageUrl": packageUrl,
"remoteManifestUrl": `${packageUrl}/project.manifest`,
"remoteVersionUrl": `${packageUrl}/version.json`,
"version": "1.0.0",
"version": "0.0",
});
this._storagePath = `${(jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "./")}${this._path}`;
@@ -192,6 +189,7 @@ export default class HUDM extends cc.Component {
}
public *HUD(onFileProgress?: (finish: number, total: number, item: string) => void): IterableIterator<any> {
this._updatePanel.updateBtn.active = false;
this._updateingData = null;
if (this._am && !this._updating) {
this._am.setEventCallback(this._updateCb.bind(this));