@galacean/effects-plugin-spine 2.0.0-alpha.10 → 2.0.0-alpha.12
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/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +12 -6
- package/dist/index.mjs.map +1 -1
- package/dist/spine-component.d.ts +2 -2
- package/dist/spine-loader.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects player spine plugin
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 十弦
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.12
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -10471,7 +10471,7 @@ function setBlending(material, mode, pma) {
|
|
|
10471
10471
|
return;
|
|
10472
10472
|
}
|
|
10473
10473
|
composition.loaderData.spineDatas = scene.jsonScene.spines.map(function(resource, index) {
|
|
10474
|
-
return readSpineData(resource, scene.bins, composition.textures);
|
|
10474
|
+
return readSpineData(resource, scene.bins, composition.textures, composition);
|
|
10475
10475
|
});
|
|
10476
10476
|
};
|
|
10477
10477
|
_proto.onCompositionDestroyed = function onCompositionDestroyed(composition) {
|
|
@@ -10481,19 +10481,22 @@ function setBlending(material, mode, pma) {
|
|
|
10481
10481
|
};
|
|
10482
10482
|
return SpineLoader;
|
|
10483
10483
|
}(effects.AbstractPlugin);
|
|
10484
|
-
function readSpineData(resource, bins, textures) {
|
|
10484
|
+
function readSpineData(resource, bins, textures, composition) {
|
|
10485
10485
|
var atlasPointer = resource.atlas, skeletonPointer = resource.skeleton, images = resource.images, skeletonType = resource.skeletonType;
|
|
10486
10486
|
var _atlasPointer_ = atlasPointer[1], index = _atlasPointer_[0], tmp = _atlasPointer_[1], start = tmp === void 0 ? 0 : tmp, bufferLength = _atlasPointer_[2];
|
|
10487
10487
|
var atlasBuffer = bins[index];
|
|
10488
10488
|
var atlasText = bufferLength ? decodeText(new Uint8Array(atlasBuffer, start, bufferLength)) : decodeText(new Uint8Array(atlasBuffer, start));
|
|
10489
10489
|
var atlas = new TextureAtlas(atlasText);
|
|
10490
10490
|
var pageCount = atlas.pages.length;
|
|
10491
|
+
var engine = composition.getEngine();
|
|
10491
10492
|
if (images.length !== pageCount) {
|
|
10492
10493
|
throw new Error("atlas.page's length not equal spine.textures' length");
|
|
10493
10494
|
}
|
|
10494
10495
|
for(var i = 0; i < pageCount; i++){
|
|
10495
10496
|
var page = atlas.pages[i];
|
|
10496
|
-
|
|
10497
|
+
// 直接获取Texture
|
|
10498
|
+
var textureId = images[i].id;
|
|
10499
|
+
var tex = engine.assetLoader.loadGUID(textureId);
|
|
10497
10500
|
if (!tex) {
|
|
10498
10501
|
throw new Error("Can not find page " + page.name + "'s texture, check the texture name");
|
|
10499
10502
|
}
|
|
@@ -10946,6 +10949,9 @@ var Vector2 = effects.math.Vector2, Vector3 = effects.math.Vector3;
|
|
|
10946
10949
|
this.startSize = options.content.options.startSize;
|
|
10947
10950
|
// @ts-expect-error
|
|
10948
10951
|
this.renderer = options.content.renderer;
|
|
10952
|
+
if (!this.state) {
|
|
10953
|
+
return;
|
|
10954
|
+
}
|
|
10949
10955
|
this.state.apply(this.skeleton);
|
|
10950
10956
|
this.update(0);
|
|
10951
10957
|
this.resize();
|
|
@@ -10966,7 +10972,7 @@ var Vector2 = effects.math.Vector2, Vector3 = effects.math.Vector3;
|
|
|
10966
10972
|
(_this_content = this.content) == null ? void 0 : _this_content.render(renderer);
|
|
10967
10973
|
};
|
|
10968
10974
|
_proto.onDestroy = function onDestroy() {
|
|
10969
|
-
if (this.item.endBehavior === effects.spec.
|
|
10975
|
+
if (this.item.endBehavior === effects.spec.ItemEndBehavior.destroy && this.state) {
|
|
10970
10976
|
this.state.clearListeners();
|
|
10971
10977
|
this.state.clearTracks();
|
|
10972
10978
|
}
|
|
@@ -11239,7 +11245,7 @@ var SpineVFXItem = /*#__PURE__*/ function(VFXItem) {
|
|
|
11239
11245
|
}(effects.VFXItem);
|
|
11240
11246
|
|
|
11241
11247
|
effects.registerPlugin("spine", SpineLoader, SpineVFXItem);
|
|
11242
|
-
var version = "2.0.0-alpha.
|
|
11248
|
+
var version = "2.0.0-alpha.12";
|
|
11243
11249
|
effects.logger.info("plugin spine version: " + version);
|
|
11244
11250
|
|
|
11245
11251
|
exports.AlphaTimeline = AlphaTimeline;
|