游戏热更新插件
This commit is contained in:
18
assets/Script/Helloworld.ts
Normal file
18
assets/Script/Helloworld.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
const {ccclass, property} = cc._decorator;
|
||||
|
||||
@ccclass
|
||||
export default class Helloworld extends cc.Component {
|
||||
|
||||
onOpenBundle() {
|
||||
cc.assetManager.loadBundle("Bundle2", (err, bundle) => {
|
||||
if (err) {
|
||||
console.error("ERROR", err);
|
||||
return;
|
||||
}
|
||||
bundle.load<cc.Prefab>("UI2", cc.Prefab, (err2, ui2) => {
|
||||
const ui = cc.instantiate(ui2);
|
||||
this.node.addChild(ui);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
9
assets/Script/Helloworld.ts.meta
Normal file
9
assets/Script/Helloworld.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.8",
|
||||
"uuid": "e1b90feb-a217-4493-849d-9a611900d683",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
Reference in New Issue
Block a user