Commit ce8afae0 authored by rockyl's avatar rockyl

增加自定义模块支持

parent 0b63ae5e
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"scripts": { "scripts": {
"build-webpack": "webpack", "build-webpack": "webpack",
"rollup": "rollup -c", "rollup": "rollup -c",
"rename": "node scripts/rename-hash.js dist/index.js", "rename": "node scripts/rename-hash.js dist/engine.js",
"build": "yarn rollup && yarn rename", "build": "yarn rollup && yarn rename",
"ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts", "ts": "dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts",
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
input: 'src/index.ts', input: 'src/index.ts',
output: [ output: [
{ {
file: `dist/index.js`, file: `dist/engine.js`,
format: 'umd', format: 'umd',
name: 'engine', name: 'engine',
sourcemap: true, sourcemap: true,
......
...@@ -92,17 +92,21 @@ export class GameStage extends Container { ...@@ -92,17 +92,21 @@ export class GameStage extends Container {
let total = assets.length; let total = assets.length;
if (customs) { if (customs) {
for (let custom of customs) { for (let custom of customs) {
if(custom.assets){
total += custom.assets.length; total += custom.assets.length;
} }
} }
}
showLoadingView(); showLoadingView();
await loadAssets(assets, p); await loadAssets(assets, p);
if (customs) { if (customs) {
for (let custom of customs) { for (let custom of customs) {
if(custom.assets){
await loadAssets(custom.assets, p); await loadAssets(custom.assets, p);
} }
} }
}
hideLoadingView(); hideLoadingView();
this.start(); this.start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment