[add] 熱更新
This commit is contained in:
@@ -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));
|
||||
|
@@ -10,6 +10,7 @@ import { Enum_HUDM } from "./HUD/Enum_HUDM";
|
||||
import HUDM from "./HUD/HUDM";
|
||||
import NativeClass from "./NativeClass";
|
||||
import UpdatePanel from "./UpdatePanel";
|
||||
import BusinessTypeSetting from "./_BusinessTypeSetting/BusinessTypeSetting";
|
||||
|
||||
const { ccclass, property } = cc._decorator;
|
||||
|
||||
@@ -35,11 +36,8 @@ export default class Manager extends cc.Component {
|
||||
}
|
||||
|
||||
private *_init(): IterableIterator<any> {
|
||||
console.log(`2022/08/30 16:26`);
|
||||
console.log(`COMPILE VERSION: ${BusinessTypeSetting.COMPILE_VERSION}`);
|
||||
cc.debug.setDisplayStats(false);
|
||||
if (CC_DEBUG) {
|
||||
console.log("Debug");
|
||||
}
|
||||
|
||||
new NativeClass(this.webview);
|
||||
if (cc.sys.isNative) {
|
||||
|
13
assets/Script/_BusinessTypeSetting.meta
Normal file
13
assets/Script/_BusinessTypeSetting.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.3",
|
||||
"uuid": "78c83bfa-4d05-4a0a-ade0-864ea68a5837",
|
||||
"importer": "folder",
|
||||
"isBundle": false,
|
||||
"bundleName": "",
|
||||
"priority": 1,
|
||||
"compressionType": {},
|
||||
"optimizeHotUpdate": {},
|
||||
"inlineSpriteFrames": {},
|
||||
"isRemoteBundle": {},
|
||||
"subMetas": {}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
export default class BusinessTypeSetting {
|
||||
/** 編譯版本 */
|
||||
public static readonly COMPILE_VERSION: string = "3.0";
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"ver": "1.1.0",
|
||||
"uuid": "b913b231-4f44-467c-a60f-065ce8e1fa42",
|
||||
"importer": "typescript",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
Reference in New Issue
Block a user