repo: janusweb action: commit revision: path_from: revision_from: 976bd2d923b37da7baa4a47a7c1161e26a7d3707: path_to: revision_to:
commit 976bd2d923b37da7baa4a47a7c1161e26a7d3707 Author: James BaicoianuDate: Thu Oct 19 20:48:18 2017 -0700 Improved hierarchical asset handling diff --git a/scripts/janusweb.js b/scripts/janusweb.js
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -75,7 +75,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
if (this.corsproxy != '') {
elation.engine.assets.setCORSProxy(this.corsproxy);
}
- elation.engine.assets.loadAssetPack(this.properties.datapath + 'assets.json', this.properties.datapath);
+ this.assetpack = elation.engine.assets.loadAssetPack(this.properties.datapath + 'assets.json', this.properties.datapath);
this.parser = new JanusFireboxParser();
this.scriptingInitialized = false;
@@ -557,5 +557,12 @@ console.log('Register new SYSTEM tag type:', tagname, classobj, extendclass);
};
}
}
+ this.getAsset = function(type, name, assetargs) {
+ var asset;
+ if (this.assetpack) {
+ asset = this.assetpack.get(type, name, assetargs);
+ }
+ return asset;
+ }
}, elation.engine.things.generic);
});
-----END OF PAGE-----