@urso/core 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,6 +4,14 @@ class ModulesAssetsModelsAtlas extends Urso.Core.Modules.Assets.BaseModel {
|
|
|
4
4
|
|
|
5
5
|
this.type = Urso.types.assets.ATLAS;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
// cacheTextures: if true - add atlas parced textures in Urso textures cache with it's file name as asset key.
|
|
9
|
+
// Example - atlas texture with path 'atlasPath/image/image_01.png' will be saved in cache with a key 'image_01'.
|
|
10
|
+
setupParams(params) {
|
|
11
|
+
super.setupParams(params);
|
|
12
|
+
|
|
13
|
+
this.cacheTextures = Urso.helper.recursiveGet('cacheTextures', params, false);
|
|
14
|
+
}
|
|
7
15
|
}
|
|
8
16
|
|
|
9
17
|
module.exports = ModulesAssetsModelsAtlas;
|
|
@@ -117,6 +117,11 @@ class ModulesAssetsService {
|
|
|
117
117
|
newFilename = folderPath + '/' + frame.filename;
|
|
118
118
|
|
|
119
119
|
Urso.cache.addFile(newFilename, texture);
|
|
120
|
+
|
|
121
|
+
if(assetModel.cacheTextures) {
|
|
122
|
+
const textureKey = newFilename.split('/').pop().split('.')[0];
|
|
123
|
+
Urso.cache.addTexture(textureKey, texture);
|
|
124
|
+
}
|
|
120
125
|
}
|
|
121
126
|
}
|
|
122
127
|
}
|