@galacean/engine-spine 4.2.5 → 4.2.6

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.
Files changed (60) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/main.js +96 -16
  3. package/dist/main.js.map +1 -1
  4. package/dist/miniprogram.js +96 -16
  5. package/dist/module.js +96 -16
  6. package/dist/module.js.map +1 -1
  7. package/package.json +1 -1
  8. package/types/AntGSpineLoader.d.ts +22 -0
  9. package/types/SpineAnimation.d.ts +45 -0
  10. package/types/SpineLoader.d.ts +32 -0
  11. package/types/SpineMaterial.d.ts +6 -0
  12. package/types/SpineRenderer.d.ts +38 -0
  13. package/types/core/MeshGenerator.d.ts +43 -0
  14. package/types/core/SpineMesh.d.ts +11 -0
  15. package/types/spine-core/Animation.d.ts +378 -0
  16. package/types/spine-core/AnimationState.d.ts +365 -0
  17. package/types/spine-core/AnimationStateData.d.ts +23 -0
  18. package/types/spine-core/AssetManager.d.ts +36 -0
  19. package/types/spine-core/AtlasAttachmentLoader.d.ts +23 -0
  20. package/types/spine-core/BlendMode.d.ts +7 -0
  21. package/types/spine-core/Bone.d.ts +110 -0
  22. package/types/spine-core/BoneData.d.ts +44 -0
  23. package/types/spine-core/ConstraintData.d.ts +7 -0
  24. package/types/spine-core/Event.d.ts +16 -0
  25. package/types/spine-core/EventData.d.ts +13 -0
  26. package/types/spine-core/IkConstraint.d.ts +38 -0
  27. package/types/spine-core/IkConstraintData.d.ts +26 -0
  28. package/types/spine-core/PathConstraint.d.ts +46 -0
  29. package/types/spine-core/PathConstraintData.d.ts +52 -0
  30. package/types/spine-core/SharedAssetManager.d.ts +19 -0
  31. package/types/spine-core/Skeleton.d.ts +134 -0
  32. package/types/spine-core/SkeletonBinary.d.ts +49 -0
  33. package/types/spine-core/SkeletonBounds.d.ts +48 -0
  34. package/types/spine-core/SkeletonClipping.d.ts +22 -0
  35. package/types/spine-core/SkeletonData.d.ts +89 -0
  36. package/types/spine-core/SkeletonJson.d.ts +34 -0
  37. package/types/spine-core/Skin.d.ts +43 -0
  38. package/types/spine-core/Slot.d.ts +42 -0
  39. package/types/spine-core/SlotData.d.ts +23 -0
  40. package/types/spine-core/Texture.d.ts +46 -0
  41. package/types/spine-core/TextureAtlas.d.ts +30 -0
  42. package/types/spine-core/TransformConstraint.d.ts +36 -0
  43. package/types/spine-core/TransformConstraintData.d.ts +34 -0
  44. package/types/spine-core/Triangulator.d.ts +14 -0
  45. package/types/spine-core/Updatable.d.ts +9 -0
  46. package/types/spine-core/Utils.d.ts +124 -0
  47. package/types/spine-core/VertexEffect.d.ts +7 -0
  48. package/types/spine-core/attachments/Attachment.d.ts +43 -0
  49. package/types/spine-core/attachments/AttachmentLoader.d.ts +25 -0
  50. package/types/spine-core/attachments/AttachmentType.d.ts +9 -0
  51. package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +12 -0
  52. package/types/spine-core/attachments/ClippingAttachment.d.ts +14 -0
  53. package/types/spine-core/attachments/MeshAttachment.d.ts +46 -0
  54. package/types/spine-core/attachments/PathAttachment.d.ts +19 -0
  55. package/types/spine-core/attachments/PointAttachment.d.ts +20 -0
  56. package/types/spine-core/attachments/RegionAttachment.d.ts +88 -0
  57. package/types/spine-core/polyfills.d.ts +3 -0
  58. package/types/spine-core/vertexeffects/JitterEffect.d.ts +11 -0
  59. package/types/spine-core/vertexeffects/SwirlEffect.d.ts +16 -0
  60. package/types/types.d.ts +4 -0
@@ -33,14 +33,9 @@ function _instanceof1(left, right) {
33
33
  } else return _instanceof1(left, right);
34
34
  }
35
35
 
36
- function _type_of(obj) {
37
- "@swc/helpers - typeof";
38
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
39
- }
40
-
41
36
  function __decorate(decorators, target, key, desc) {
42
37
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
43
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
38
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
44
39
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
45
40
  return c > 3 && r && Object.defineProperty(target, key, r), r;
46
41
  }
@@ -175,7 +170,34 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
175
170
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
176
171
  }
177
172
 
178
- var IntSet = /*#__PURE__*/ function() {
173
+ /******************************************************************************
174
+ * Spine Runtimes License Agreement
175
+ * Last updated April 5, 2025. Replaces all prior versions.
176
+ *
177
+ * Copyright (c) 2013-2025, Esoteric Software LLC
178
+ *
179
+ * Integration of the Spine Runtimes into software or otherwise creating
180
+ * derivative works of the Spine Runtimes is permitted under the terms and
181
+ * conditions of Section 2 of the Spine Editor License Agreement:
182
+ * http://esotericsoftware.com/spine-editor-license
183
+ *
184
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
185
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
186
+ * "Products"), provided that each user of the Products must obtain their own
187
+ * Spine Editor license and redistribution of the Products in any form must
188
+ * include this license and copyright notice.
189
+ *
190
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
191
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
192
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
193
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
194
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
195
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
196
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
197
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
198
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
199
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
200
+ *****************************************************************************/ var IntSet = /*#__PURE__*/ function() {
179
201
  function IntSet() {
180
202
  this.array = new Array();
181
203
  }
@@ -3922,7 +3944,34 @@ var CURRENT = 2;
3922
3944
  }
3923
3945
  (VertexAttachment);
3924
3946
 
3925
- var Texture = /*#__PURE__*/ function() {
3947
+ /******************************************************************************
3948
+ * Spine Runtimes License Agreement
3949
+ * Last updated April 5, 2025. Replaces all prior versions.
3950
+ *
3951
+ * Copyright (c) 2013-2025, Esoteric Software LLC
3952
+ *
3953
+ * Integration of the Spine Runtimes into software or otherwise creating
3954
+ * derivative works of the Spine Runtimes is permitted under the terms and
3955
+ * conditions of Section 2 of the Spine Editor License Agreement:
3956
+ * http://esotericsoftware.com/spine-editor-license
3957
+ *
3958
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
3959
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
3960
+ * "Products"), provided that each user of the Products must obtain their own
3961
+ * Spine Editor license and redistribution of the Products in any form must
3962
+ * include this license and copyright notice.
3963
+ *
3964
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
3965
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
3966
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
3967
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
3968
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
3969
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
3970
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
3971
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3972
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3973
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3974
+ *****************************************************************************/ var Texture = /*#__PURE__*/ function() {
3926
3975
  function Texture(image) {
3927
3976
  this._image = image;
3928
3977
  }
@@ -5154,7 +5203,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5154
5203
  }) : null;
5155
5204
  }).then(function(bitmap) {
5156
5205
  if (bitmap) {
5157
- var texture = _this.textureLoader(bitmap);
5206
+ var texture = _this.createTexture(path, bitmap);
5158
5207
  _this.success(success, path, texture);
5159
5208
  resolve(texture);
5160
5209
  }
@@ -5163,7 +5212,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5163
5212
  var image = new engineMiniprogramAdapter.Image();
5164
5213
  image.crossOrigin = "anonymous";
5165
5214
  image.onload = function() {
5166
- var texture = _this.textureLoader(image);
5215
+ var texture = _this.createTexture(path, image);
5167
5216
  _this.success(success, path, texture);
5168
5217
  resolve(texture);
5169
5218
  };
@@ -5207,7 +5256,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5207
5256
  abort = true;
5208
5257
  });
5209
5258
  };
5210
- var atlas = new TextureAtlas(atlasText);
5259
+ var atlas = _this.createTextureAtlas(path, atlasText);
5211
5260
  var toLoad = atlas.pages.length, abort = false;
5212
5261
  for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;)_loop();
5213
5262
  } catch (e) {
@@ -5231,7 +5280,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5231
5280
  this.cache.assetsLoaded[path] = new Promise(function(resolve, reject) {
5232
5281
  _this.downloader.downloadText(path, function(atlasText) {
5233
5282
  try {
5234
- var atlas = new TextureAtlas(atlasText);
5283
+ var atlas = _this.createTextureAtlas(path, atlasText);
5235
5284
  _this.success(success, path, atlas);
5236
5285
  resolve(atlas);
5237
5286
  } catch (e) {
@@ -5382,9 +5431,12 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5382
5431
  };
5383
5432
  // dispose asset only if it's not used by others
5384
5433
  _proto.disposeAsset = function disposeAsset(path) {
5385
- if (--this.cache.assetsRefCount[path] === 0) {
5386
- this.remove(path);
5434
+ var asset = this.cache.assets[path];
5435
+ if (_instanceof1(asset, TextureAtlas)) {
5436
+ asset.dispose();
5437
+ return;
5387
5438
  }
5439
+ this.disposeAssetInternal(path);
5388
5440
  };
5389
5441
  _proto.hasErrors = function hasErrors() {
5390
5442
  return Object.keys(this.errors).length > 0;
@@ -5392,6 +5444,34 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5392
5444
  _proto.getErrors = function getErrors() {
5393
5445
  return this.errors;
5394
5446
  };
5447
+ _proto.disposeAssetInternal = function disposeAssetInternal(path) {
5448
+ if (this.cache.assetsRefCount[path] > 0 && --this.cache.assetsRefCount[path] === 0) {
5449
+ return this.remove(path);
5450
+ }
5451
+ };
5452
+ _proto.createTextureAtlas = function createTextureAtlas(path, atlasText) {
5453
+ var _this = this;
5454
+ var atlas = new TextureAtlas(atlasText);
5455
+ atlas.dispose = function() {
5456
+ if (_this.cache.assetsRefCount[path] <= 0) return;
5457
+ _this.disposeAssetInternal(path);
5458
+ for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;){
5459
+ var page = _step.value;
5460
+ var _page_texture;
5461
+ (_page_texture = page.texture) == null ? void 0 : _page_texture.dispose();
5462
+ }
5463
+ };
5464
+ return atlas;
5465
+ };
5466
+ _proto.createTexture = function createTexture(path, image) {
5467
+ var _this = this;
5468
+ var texture = this.textureLoader(image);
5469
+ var textureDispose = texture.dispose.bind(texture);
5470
+ texture.dispose = function() {
5471
+ if (_this.disposeAssetInternal(path)) textureDispose();
5472
+ };
5473
+ return texture;
5474
+ };
5395
5475
  return AssetManagerBase;
5396
5476
  }();
5397
5477
  var AssetCache = /*#__PURE__*/ function() {
@@ -12039,7 +12119,7 @@ var SpineAtlasLoader = /*#__PURE__*/ function(Loader) {
12039
12119
  SpineAtlasLoader = __decorate([
12040
12120
  miniprogram.resourceLoader("SpineAtlas", [
12041
12121
  "atlas"
12042
- ])
12122
+ ], false)
12043
12123
  ], SpineAtlasLoader);
12044
12124
 
12045
12125
  var LoaderObject = /*#__PURE__*/Object.freeze({
@@ -12060,7 +12140,7 @@ for(var key in RendererObject){
12060
12140
  for(var key1 in LoaderObject){
12061
12141
  miniprogram.Loader.registerClass(key1, LoaderObject[key1]);
12062
12142
  }
12063
- var version = "4.2.5";
12143
+ var version = "4.2.6";
12064
12144
  console.log("Galacean spine version: " + version);
12065
12145
 
12066
12146
  exports.AlphaTimeline = AlphaTimeline;
package/dist/module.js CHANGED
@@ -28,14 +28,9 @@ function _instanceof1(left, right) {
28
28
  } else return _instanceof1(left, right);
29
29
  }
30
30
 
31
- function _type_of(obj) {
32
- "@swc/helpers - typeof";
33
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
34
- }
35
-
36
31
  function __decorate(decorators, target, key, desc) {
37
32
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
38
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
39
34
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
40
35
  return c > 3 && r && Object.defineProperty(target, key, r), r;
41
36
  }
@@ -170,7 +165,34 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
170
165
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
171
166
  }
172
167
 
173
- var IntSet = /*#__PURE__*/ function() {
168
+ /******************************************************************************
169
+ * Spine Runtimes License Agreement
170
+ * Last updated April 5, 2025. Replaces all prior versions.
171
+ *
172
+ * Copyright (c) 2013-2025, Esoteric Software LLC
173
+ *
174
+ * Integration of the Spine Runtimes into software or otherwise creating
175
+ * derivative works of the Spine Runtimes is permitted under the terms and
176
+ * conditions of Section 2 of the Spine Editor License Agreement:
177
+ * http://esotericsoftware.com/spine-editor-license
178
+ *
179
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
180
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
181
+ * "Products"), provided that each user of the Products must obtain their own
182
+ * Spine Editor license and redistribution of the Products in any form must
183
+ * include this license and copyright notice.
184
+ *
185
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
186
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
187
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
188
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
189
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
190
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
191
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
192
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
193
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
194
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
195
+ *****************************************************************************/ var IntSet = /*#__PURE__*/ function() {
174
196
  function IntSet() {
175
197
  this.array = new Array();
176
198
  }
@@ -3917,7 +3939,34 @@ var CURRENT = 2;
3917
3939
  }
3918
3940
  (VertexAttachment);
3919
3941
 
3920
- var Texture = /*#__PURE__*/ function() {
3942
+ /******************************************************************************
3943
+ * Spine Runtimes License Agreement
3944
+ * Last updated April 5, 2025. Replaces all prior versions.
3945
+ *
3946
+ * Copyright (c) 2013-2025, Esoteric Software LLC
3947
+ *
3948
+ * Integration of the Spine Runtimes into software or otherwise creating
3949
+ * derivative works of the Spine Runtimes is permitted under the terms and
3950
+ * conditions of Section 2 of the Spine Editor License Agreement:
3951
+ * http://esotericsoftware.com/spine-editor-license
3952
+ *
3953
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
3954
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
3955
+ * "Products"), provided that each user of the Products must obtain their own
3956
+ * Spine Editor license and redistribution of the Products in any form must
3957
+ * include this license and copyright notice.
3958
+ *
3959
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
3960
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
3961
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
3962
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
3963
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
3964
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
3965
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
3966
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3967
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3968
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3969
+ *****************************************************************************/ var Texture = /*#__PURE__*/ function() {
3921
3970
  function Texture(image) {
3922
3971
  this._image = image;
3923
3972
  }
@@ -5149,7 +5198,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5149
5198
  }) : null;
5150
5199
  }).then(function(bitmap) {
5151
5200
  if (bitmap) {
5152
- var texture = _this.textureLoader(bitmap);
5201
+ var texture = _this.createTexture(path, bitmap);
5153
5202
  _this.success(success, path, texture);
5154
5203
  resolve(texture);
5155
5204
  }
@@ -5158,7 +5207,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5158
5207
  var image = new Image();
5159
5208
  image.crossOrigin = "anonymous";
5160
5209
  image.onload = function() {
5161
- var texture = _this.textureLoader(image);
5210
+ var texture = _this.createTexture(path, image);
5162
5211
  _this.success(success, path, texture);
5163
5212
  resolve(texture);
5164
5213
  };
@@ -5202,7 +5251,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5202
5251
  abort = true;
5203
5252
  });
5204
5253
  };
5205
- var atlas = new TextureAtlas(atlasText);
5254
+ var atlas = _this.createTextureAtlas(path, atlasText);
5206
5255
  var toLoad = atlas.pages.length, abort = false;
5207
5256
  for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;)_loop();
5208
5257
  } catch (e) {
@@ -5226,7 +5275,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5226
5275
  this.cache.assetsLoaded[path] = new Promise(function(resolve, reject) {
5227
5276
  _this.downloader.downloadText(path, function(atlasText) {
5228
5277
  try {
5229
- var atlas = new TextureAtlas(atlasText);
5278
+ var atlas = _this.createTextureAtlas(path, atlasText);
5230
5279
  _this.success(success, path, atlas);
5231
5280
  resolve(atlas);
5232
5281
  } catch (e) {
@@ -5377,9 +5426,12 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5377
5426
  };
5378
5427
  // dispose asset only if it's not used by others
5379
5428
  _proto.disposeAsset = function disposeAsset(path) {
5380
- if (--this.cache.assetsRefCount[path] === 0) {
5381
- this.remove(path);
5429
+ var asset = this.cache.assets[path];
5430
+ if (_instanceof1(asset, TextureAtlas)) {
5431
+ asset.dispose();
5432
+ return;
5382
5433
  }
5434
+ this.disposeAssetInternal(path);
5383
5435
  };
5384
5436
  _proto.hasErrors = function hasErrors() {
5385
5437
  return Object.keys(this.errors).length > 0;
@@ -5387,6 +5439,34 @@ var AssetManagerBase = /*#__PURE__*/ function() {
5387
5439
  _proto.getErrors = function getErrors() {
5388
5440
  return this.errors;
5389
5441
  };
5442
+ _proto.disposeAssetInternal = function disposeAssetInternal(path) {
5443
+ if (this.cache.assetsRefCount[path] > 0 && --this.cache.assetsRefCount[path] === 0) {
5444
+ return this.remove(path);
5445
+ }
5446
+ };
5447
+ _proto.createTextureAtlas = function createTextureAtlas(path, atlasText) {
5448
+ var _this = this;
5449
+ var atlas = new TextureAtlas(atlasText);
5450
+ atlas.dispose = function() {
5451
+ if (_this.cache.assetsRefCount[path] <= 0) return;
5452
+ _this.disposeAssetInternal(path);
5453
+ for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;){
5454
+ var page = _step.value;
5455
+ var _page_texture;
5456
+ (_page_texture = page.texture) == null ? void 0 : _page_texture.dispose();
5457
+ }
5458
+ };
5459
+ return atlas;
5460
+ };
5461
+ _proto.createTexture = function createTexture(path, image) {
5462
+ var _this = this;
5463
+ var texture = this.textureLoader(image);
5464
+ var textureDispose = texture.dispose.bind(texture);
5465
+ texture.dispose = function() {
5466
+ if (_this.disposeAssetInternal(path)) textureDispose();
5467
+ };
5468
+ return texture;
5469
+ };
5390
5470
  return AssetManagerBase;
5391
5471
  }();
5392
5472
  var AssetCache = /*#__PURE__*/ function() {
@@ -12034,7 +12114,7 @@ var SpineAtlasLoader = /*#__PURE__*/ function(Loader) {
12034
12114
  SpineAtlasLoader = __decorate([
12035
12115
  resourceLoader("SpineAtlas", [
12036
12116
  "atlas"
12037
- ])
12117
+ ], false)
12038
12118
  ], SpineAtlasLoader);
12039
12119
 
12040
12120
  var LoaderObject = /*#__PURE__*/Object.freeze({
@@ -12055,7 +12135,7 @@ for(var key in RendererObject){
12055
12135
  for(var key1 in LoaderObject){
12056
12136
  Loader.registerClass(key1, LoaderObject[key1]);
12057
12137
  }
12058
- var version = "4.2.5";
12138
+ var version = "4.2.6";
12059
12139
  console.log("Galacean spine version: " + version);
12060
12140
 
12061
12141
  export { AlphaTimeline, Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AssetCache, AssetManagerBase, AtlasAttachmentLoader, Attachment, AttachmentTimeline, BinaryInput, BlendMode, Bone, BoneData, BoundingBoxAttachment, CURRENT, ClippingAttachment, Color, ConstraintData, CurveTimeline, CurveTimeline1, CurveTimeline2, DebugUtils, DeformTimeline, Downloader, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, FIRST, FakeTexture, HOLD_FIRST, HOLD_MIX, HOLD_SUBSEQUENT, IkConstraint, IkConstraintData, IkConstraintTimeline, Inherit, InheritTimeline, IntSet, Interpolation, LoaderUtils, MathUtils, MeshAttachment, MixBlend, MixDirection, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, Physics, PhysicsConstraintDampingTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintMixTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintTimeline, PhysicsConstraintWindTimeline, PointAttachment, Pool, PositionMode, Pow, PowOut, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RegionAttachment, RotateMode, RotateTimeline, SETUP, SUBSEQUENT, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonClipping, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, SpineAnimationRenderer, SpineMaterial, SpineResource, StringSet, Texture, TextureAtlas, TextureAtlasPage, TextureAtlasRegion, TextureFilter, TextureRegion, TextureWrap, TimeKeeper, Timeline, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, Triangulator, Utils, Vector2, VertexAttachment, WindowedMean, version };