repo: janusweb action: commit revision: path_from: revision_from: 5b6ddc4f0e928909fbbf4b373fa1370f3f4d8cfa: path_to: revision_to:
commit 5b6ddc4f0e928909fbbf4b373fa1370f3f4d8cfa Author: James BaicoianuDate: Thu Oct 19 22:41:22 2017 -0700 Implemented hierarchical asset loading diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -242,11 +242,22 @@ elation.require(['engine.things.generic', 'utils.template'], function() {
}
return childproxies;
}
- this.getAsset = function(type, id) {
- if (!this.assets[type]) {
- this.assets[type] = {};
+ this.getAsset = function(type, id, nocache) {
+ var parent = this.parent || this.room;
+
+ var asset;
+ if (this.assetpack) {
+ asset = this.assetpack.get(type, id);
+ }
+ if (!asset) {
+ asset = parent.getAsset(type, id);
+ }
+ if (asset && !nocache) {
+ if (!this.assets[type]) {
+ this.assets[type] = {};
+ }
+ this.assets[type][id] = asset;
}
- var asset = this.assets[type][id] = this.room.getAsset(type, id);
return asset;
}
this.getActiveAssets = function(assetlist) {
-----END OF PAGE-----