@galacean/engine-spine 4.2.0 → 4.2.1
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/README.md +64 -42
- package/dist/browser.js +1 -1
- package/dist/main.js +635 -1056
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +635 -1056
- package/dist/module.js +634 -1056
- package/dist/module.js.map +1 -1
- package/package.json +50 -38
- package/types/index.d.ts +2 -5
- package/types/loader/LoaderUtils.d.ts +11 -17
- package/types/loader/SpineAtlasLoader.d.ts +7 -0
- package/types/loader/SpineLoader.d.ts +11 -25
- package/types/loader/SpineResource.d.ts +33 -0
- package/types/loader/SpineTexture.d.ts +13 -0
- package/types/loader/index.d.ts +4 -0
- package/types/{SpineAnimationRenderer.d.ts → renderer/SpineAnimationRenderer.d.ts} +45 -81
- package/types/{SpineGenerator.d.ts → renderer/SpineGenerator.d.ts} +12 -15
- package/types/renderer/index.d.ts +2 -0
- package/types/util/BlendMode.d.ts +1 -1
- package/types/loader/EditorSpineAtlasLoader.d.ts +0 -6
- package/types/loader/SkeletonDataResource.d.ts +0 -12
- package/types/tsconfig.tsbuildinfo +0 -1
- package/types/util/BufferReader.d.ts +0 -10
- /package/types/{SpineMaterial.d.ts → renderer/SpineMaterial.d.ts} +0 -0
package/dist/main.js
CHANGED
|
@@ -4,33 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var engine = require('@galacean/engine');
|
|
6
6
|
|
|
7
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8
|
-
try {
|
|
9
|
-
var info = gen[key](arg);
|
|
10
|
-
var value = info.value;
|
|
11
|
-
} catch (error) {
|
|
12
|
-
reject(error);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (info.done) resolve(value);
|
|
16
|
-
else Promise.resolve(value).then(_next, _throw);
|
|
17
|
-
}
|
|
18
|
-
function _async_to_generator(fn) {
|
|
19
|
-
return function() {
|
|
20
|
-
var self = this, args = arguments;
|
|
21
|
-
return new Promise(function(resolve, reject) {
|
|
22
|
-
var gen = fn.apply(self, args);
|
|
23
|
-
function _next(value) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
25
|
-
}
|
|
26
|
-
function _throw(err) {
|
|
27
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
28
|
-
}
|
|
29
|
-
_next(undefined);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
7
|
function _set_prototype_of(o, p) {
|
|
35
8
|
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
36
9
|
o.__proto__ = p;
|
|
@@ -70,97 +43,6 @@ function __decorate(decorators, target, key, desc) {
|
|
|
70
43
|
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;
|
|
71
44
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
72
45
|
}
|
|
73
|
-
function __generator(thisArg, body) {
|
|
74
|
-
var _ = {
|
|
75
|
-
label: 0,
|
|
76
|
-
sent: function sent() {
|
|
77
|
-
if (t[0] & 1) throw t[1];
|
|
78
|
-
return t[1];
|
|
79
|
-
},
|
|
80
|
-
trys: [],
|
|
81
|
-
ops: []
|
|
82
|
-
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
83
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
84
|
-
return this;
|
|
85
|
-
}), g;
|
|
86
|
-
function verb(n) {
|
|
87
|
-
return function(v) {
|
|
88
|
-
return step([
|
|
89
|
-
n,
|
|
90
|
-
v
|
|
91
|
-
]);
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function step(op) {
|
|
95
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
96
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
97
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
98
|
-
if (y = 0, t) op = [
|
|
99
|
-
op[0] & 2,
|
|
100
|
-
t.value
|
|
101
|
-
];
|
|
102
|
-
switch(op[0]){
|
|
103
|
-
case 0:
|
|
104
|
-
case 1:
|
|
105
|
-
t = op;
|
|
106
|
-
break;
|
|
107
|
-
case 4:
|
|
108
|
-
_.label++;
|
|
109
|
-
return {
|
|
110
|
-
value: op[1],
|
|
111
|
-
done: false
|
|
112
|
-
};
|
|
113
|
-
case 5:
|
|
114
|
-
_.label++;
|
|
115
|
-
y = op[1];
|
|
116
|
-
op = [
|
|
117
|
-
0
|
|
118
|
-
];
|
|
119
|
-
continue;
|
|
120
|
-
case 7:
|
|
121
|
-
op = _.ops.pop();
|
|
122
|
-
_.trys.pop();
|
|
123
|
-
continue;
|
|
124
|
-
default:
|
|
125
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
126
|
-
_ = 0;
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
130
|
-
_.label = op[1];
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
134
|
-
_.label = t[1];
|
|
135
|
-
t = op;
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
if (t && _.label < t[2]) {
|
|
139
|
-
_.label = t[2];
|
|
140
|
-
_.ops.push(op);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
if (t[2]) _.ops.pop();
|
|
144
|
-
_.trys.pop();
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
op = body.call(thisArg, _);
|
|
148
|
-
} catch (e) {
|
|
149
|
-
op = [
|
|
150
|
-
6,
|
|
151
|
-
e
|
|
152
|
-
];
|
|
153
|
-
y = 0;
|
|
154
|
-
} finally{
|
|
155
|
-
f = t = 0;
|
|
156
|
-
}
|
|
157
|
-
if (op[0] & 5) throw op[1];
|
|
158
|
-
return {
|
|
159
|
-
value: op[0] ? op[1] : void 0,
|
|
160
|
-
done: true
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
46
|
typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
|
|
165
47
|
var e = new Error(message);
|
|
166
48
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -10590,198 +10472,33 @@ function getValue(map, property, defaultValue) {
|
|
|
10590
10472
|
}
|
|
10591
10473
|
})();
|
|
10592
10474
|
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
return new SkeletonBinary(atlasLoader).readSkeletonData(new Uint8Array(skeletonTextData));
|
|
10599
|
-
}
|
|
10600
|
-
}
|
|
10601
|
-
function loadTexturesByPath(imagePaths, imageExtensions, engine) {
|
|
10602
|
-
return _loadTexturesByPath.apply(this, arguments);
|
|
10603
|
-
}
|
|
10604
|
-
function _loadTexturesByPath() {
|
|
10605
|
-
_loadTexturesByPath = _async_to_generator(function(imagePaths, imageExtensions, engine$1) {
|
|
10606
|
-
var textures, texturePromises, error;
|
|
10607
|
-
return __generator(this, function(_state) {
|
|
10608
|
-
switch(_state.label){
|
|
10609
|
-
case 0:
|
|
10610
|
-
texturePromises = imagePaths.map(function(imagePath, index) {
|
|
10611
|
-
var ext = imageExtensions[index];
|
|
10612
|
-
var imageLoaderType = engine.AssetType.Texture2D;
|
|
10613
|
-
if (ext === 'ktx') {
|
|
10614
|
-
imageLoaderType = engine.AssetType.KTX;
|
|
10615
|
-
} else if (ext === 'ktx2') {
|
|
10616
|
-
imageLoaderType = engine.AssetType.KTX2;
|
|
10617
|
-
}
|
|
10618
|
-
return loadTexture(imagePath, engine$1, imageLoaderType);
|
|
10619
|
-
});
|
|
10620
|
-
_state.label = 1;
|
|
10621
|
-
case 1:
|
|
10622
|
-
_state.trys.push([
|
|
10623
|
-
1,
|
|
10624
|
-
3,
|
|
10625
|
-
,
|
|
10626
|
-
4
|
|
10627
|
-
]);
|
|
10628
|
-
return [
|
|
10629
|
-
4,
|
|
10630
|
-
Promise.all(texturePromises)
|
|
10631
|
-
];
|
|
10632
|
-
case 2:
|
|
10633
|
-
textures = _state.sent();
|
|
10634
|
-
return [
|
|
10635
|
-
3,
|
|
10636
|
-
4
|
|
10637
|
-
];
|
|
10638
|
-
case 3:
|
|
10639
|
-
error = _state.sent();
|
|
10640
|
-
throw error;
|
|
10641
|
-
case 4:
|
|
10642
|
-
return [
|
|
10643
|
-
2,
|
|
10644
|
-
textures
|
|
10645
|
-
];
|
|
10646
|
-
}
|
|
10647
|
-
});
|
|
10648
|
-
});
|
|
10649
|
-
return _loadTexturesByPath.apply(this, arguments);
|
|
10650
|
-
}
|
|
10651
|
-
function loadTextureAtlas(atlasPath, engine) {
|
|
10652
|
-
return _loadTextureAtlas.apply(this, arguments);
|
|
10653
|
-
}
|
|
10654
|
-
function _loadTextureAtlas() {
|
|
10655
|
-
_loadTextureAtlas = _async_to_generator(function(atlasPath, engine$1) {
|
|
10656
|
-
var baseUrl, atlasText, textures, err, textureAtlas, loadTexturePromises, _iterator, _step, page, textureUrl, err1;
|
|
10657
|
-
return __generator(this, function(_state) {
|
|
10658
|
-
switch(_state.label){
|
|
10659
|
-
case 0:
|
|
10660
|
-
baseUrl = getBaseUrl(atlasPath);
|
|
10661
|
-
_state.label = 1;
|
|
10662
|
-
case 1:
|
|
10663
|
-
_state.trys.push([
|
|
10664
|
-
1,
|
|
10665
|
-
3,
|
|
10666
|
-
,
|
|
10667
|
-
4
|
|
10668
|
-
]);
|
|
10669
|
-
return [
|
|
10670
|
-
4,
|
|
10671
|
-
engine.request(atlasPath, {
|
|
10672
|
-
type: "text"
|
|
10673
|
-
})
|
|
10674
|
-
];
|
|
10675
|
-
case 2:
|
|
10676
|
-
atlasText = _state.sent();
|
|
10677
|
-
return [
|
|
10678
|
-
3,
|
|
10679
|
-
4
|
|
10680
|
-
];
|
|
10681
|
-
case 3:
|
|
10682
|
-
err = _state.sent();
|
|
10683
|
-
throw new Error("Spine Atlas: " + atlasPath + " load error: " + err);
|
|
10684
|
-
case 4:
|
|
10685
|
-
textureAtlas = new TextureAtlas(atlasText);
|
|
10686
|
-
loadTexturePromises = [];
|
|
10687
|
-
for(_iterator = _create_for_of_iterator_helper_loose(textureAtlas.pages); !(_step = _iterator()).done;){
|
|
10688
|
-
page = _step.value;
|
|
10689
|
-
textureUrl = baseUrl + page.name;
|
|
10690
|
-
loadTexturePromises.push(loadTexture(textureUrl, engine$1));
|
|
10691
|
-
}
|
|
10692
|
-
_state.label = 5;
|
|
10693
|
-
case 5:
|
|
10694
|
-
_state.trys.push([
|
|
10695
|
-
5,
|
|
10696
|
-
7,
|
|
10697
|
-
,
|
|
10698
|
-
8
|
|
10699
|
-
]);
|
|
10700
|
-
return [
|
|
10701
|
-
4,
|
|
10702
|
-
Promise.all(loadTexturePromises)
|
|
10703
|
-
];
|
|
10704
|
-
case 6:
|
|
10705
|
-
textures = _state.sent();
|
|
10706
|
-
return [
|
|
10707
|
-
3,
|
|
10708
|
-
8
|
|
10709
|
-
];
|
|
10710
|
-
case 7:
|
|
10711
|
-
err1 = _state.sent();
|
|
10712
|
-
throw new Error("Spine Texture: load error: " + err1);
|
|
10713
|
-
case 8:
|
|
10714
|
-
textureAtlas = createTextureAtlas(atlasText, textures);
|
|
10715
|
-
return [
|
|
10716
|
-
2,
|
|
10717
|
-
textureAtlas
|
|
10718
|
-
];
|
|
10719
|
-
}
|
|
10720
|
-
});
|
|
10721
|
-
});
|
|
10722
|
-
return _loadTextureAtlas.apply(this, arguments);
|
|
10723
|
-
}
|
|
10724
|
-
function createTextureAtlas(atlasText, textures) {
|
|
10725
|
-
var textureAtlas = new TextureAtlas(atlasText);
|
|
10726
|
-
textureAtlas.pages.forEach(function(page, index) {
|
|
10727
|
-
var engineTexture = textures.find(function(item) {
|
|
10728
|
-
return item.name === page.name;
|
|
10729
|
-
}) || textures[index];
|
|
10730
|
-
var texture = createAdaptiveTexture(engineTexture);
|
|
10731
|
-
page.setTexture(texture);
|
|
10732
|
-
});
|
|
10733
|
-
return textureAtlas;
|
|
10734
|
-
}
|
|
10735
|
-
function loadTexture(url, engine$1, imageLoaderType) {
|
|
10736
|
-
if (imageLoaderType === void 0) imageLoaderType = engine.AssetType.Texture2D;
|
|
10737
|
-
return engine$1.resourceManager.load({
|
|
10738
|
-
url: url,
|
|
10739
|
-
type: imageLoaderType
|
|
10740
|
-
});
|
|
10741
|
-
}
|
|
10742
|
-
function createAdaptiveTexture(texture) {
|
|
10743
|
-
return new AdaptiveTexture(new Image(), texture);
|
|
10744
|
-
}
|
|
10745
|
-
function getBaseUrl(url) {
|
|
10746
|
-
var isLocalPath = !/^(http|https|ftp):\/\/.*/i.test(url);
|
|
10747
|
-
if (isLocalPath) {
|
|
10748
|
-
var lastSlashIndex = url.lastIndexOf('/');
|
|
10749
|
-
if (lastSlashIndex === -1) {
|
|
10750
|
-
return '';
|
|
10751
|
-
}
|
|
10752
|
-
return url.substring(0, lastSlashIndex + 1);
|
|
10753
|
-
} else {
|
|
10754
|
-
var parsedUrl = new URL(url);
|
|
10755
|
-
var basePath = parsedUrl.origin + parsedUrl.pathname;
|
|
10756
|
-
return basePath.endsWith('/') ? basePath : basePath.substring(0, basePath.lastIndexOf('/') + 1);
|
|
10757
|
-
}
|
|
10758
|
-
}
|
|
10759
|
-
var AdaptiveTexture = /*#__PURE__*/ function(Texture) {
|
|
10760
|
-
_inherits(AdaptiveTexture, Texture);
|
|
10761
|
-
function AdaptiveTexture(image, texture) {
|
|
10475
|
+
/**
|
|
10476
|
+
* @internal
|
|
10477
|
+
*/ var SpineTexture = /*#__PURE__*/ function(Texture) {
|
|
10478
|
+
_inherits(SpineTexture, Texture);
|
|
10479
|
+
function SpineTexture(image) {
|
|
10762
10480
|
var _this;
|
|
10763
10481
|
_this = Texture.call(this, image) || this;
|
|
10764
|
-
|
|
10765
|
-
_this.texture.generateMipmaps();
|
|
10482
|
+
image.generateMipmaps();
|
|
10766
10483
|
return _this;
|
|
10767
10484
|
}
|
|
10768
|
-
var _proto =
|
|
10485
|
+
var _proto = SpineTexture.prototype;
|
|
10769
10486
|
// rewrite getImage function, return galacean texture2D, then attachment can get size of texture
|
|
10770
10487
|
_proto.getImage = function getImage() {
|
|
10771
|
-
return this.
|
|
10488
|
+
return this._image;
|
|
10772
10489
|
};
|
|
10773
10490
|
_proto.setFilters = function setFilters(minFilter, magFilter) {
|
|
10774
10491
|
if (minFilter === exports.TextureFilter.Nearest) {
|
|
10775
|
-
this.
|
|
10492
|
+
this._image.filterMode = engine.TextureFilterMode.Point;
|
|
10776
10493
|
} else if (magFilter === exports.TextureFilter.MipMapLinearLinear) {
|
|
10777
|
-
this.
|
|
10494
|
+
this._image.filterMode = engine.TextureFilterMode.Trilinear;
|
|
10778
10495
|
} else {
|
|
10779
|
-
this.
|
|
10496
|
+
this._image.filterMode = engine.TextureFilterMode.Bilinear;
|
|
10780
10497
|
}
|
|
10781
10498
|
};
|
|
10782
10499
|
_proto.setWraps = function setWraps(uWrap, vWrap) {
|
|
10783
|
-
this.
|
|
10784
|
-
this.
|
|
10500
|
+
this._image.wrapModeU = this._convertWrapMode(uWrap);
|
|
10501
|
+
this._image.wrapModeV = this._convertWrapMode(vWrap);
|
|
10785
10502
|
};
|
|
10786
10503
|
_proto.dispose = function dispose() {};
|
|
10787
10504
|
_proto._convertWrapMode = function _convertWrapMode(wrap) {
|
|
@@ -10796,63 +10513,110 @@ var AdaptiveTexture = /*#__PURE__*/ function(Texture) {
|
|
|
10796
10513
|
throw new Error("Unsupported texture wrap mode.");
|
|
10797
10514
|
}
|
|
10798
10515
|
};
|
|
10799
|
-
return
|
|
10516
|
+
return SpineTexture;
|
|
10800
10517
|
}(Texture);
|
|
10801
10518
|
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
var
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
return new
|
|
10816
|
-
}
|
|
10817
|
-
|
|
10519
|
+
/**
|
|
10520
|
+
* @internal
|
|
10521
|
+
*/ var LoaderUtils = /*#__PURE__*/ function() {
|
|
10522
|
+
function LoaderUtils() {}
|
|
10523
|
+
LoaderUtils.createSkeletonData = function createSkeletonData(skeletonRawData, textureAtlas, skeletonDataScale) {
|
|
10524
|
+
var atlasLoader = new AtlasAttachmentLoader(textureAtlas);
|
|
10525
|
+
if (typeof skeletonRawData === "string") {
|
|
10526
|
+
var skeletonJson = new SkeletonJson(atlasLoader);
|
|
10527
|
+
skeletonJson.scale = skeletonDataScale;
|
|
10528
|
+
return skeletonJson.readSkeletonData(skeletonRawData);
|
|
10529
|
+
} else {
|
|
10530
|
+
var skeletonBinary = new SkeletonBinary(atlasLoader);
|
|
10531
|
+
skeletonBinary.scale = skeletonDataScale;
|
|
10532
|
+
return skeletonBinary.readSkeletonData(new Uint8Array(skeletonRawData));
|
|
10533
|
+
}
|
|
10534
|
+
};
|
|
10535
|
+
LoaderUtils.createTextureAtlas = function createTextureAtlas(atlasText, textures) {
|
|
10536
|
+
var textureAtlas = new TextureAtlas(atlasText);
|
|
10537
|
+
textureAtlas.pages.forEach(function(page, index) {
|
|
10538
|
+
var engineTexture = textures.find(function(item) {
|
|
10539
|
+
return item.name === page.name;
|
|
10540
|
+
}) || textures[index];
|
|
10541
|
+
var texture = new SpineTexture(engineTexture);
|
|
10542
|
+
page.setTexture(texture);
|
|
10543
|
+
});
|
|
10544
|
+
return textureAtlas;
|
|
10818
10545
|
};
|
|
10819
|
-
|
|
10820
|
-
|
|
10546
|
+
LoaderUtils.loadTexturesByPaths = function loadTexturesByPaths(imagePaths, imageExtensions, engine$1, reject) {
|
|
10547
|
+
var resourceManager = engine$1.resourceManager;
|
|
10548
|
+
// @ts-ignore
|
|
10549
|
+
var virtualPathResourceMap = resourceManager._virtualPathResourceMap;
|
|
10550
|
+
var texturePromises = imagePaths.map(function(imagePath, index) {
|
|
10551
|
+
var ext = imageExtensions[index];
|
|
10552
|
+
var imageLoaderType = engine.AssetType.Texture2D;
|
|
10553
|
+
var virtualElement = virtualPathResourceMap[imagePath];
|
|
10554
|
+
if (virtualElement) {
|
|
10555
|
+
imageLoaderType = virtualElement.type;
|
|
10556
|
+
} else if (ext === "ktx") {
|
|
10557
|
+
imageLoaderType = engine.AssetType.KTX;
|
|
10558
|
+
} else if (ext === "ktx2") {
|
|
10559
|
+
imageLoaderType = engine.AssetType.KTX2;
|
|
10560
|
+
}
|
|
10561
|
+
return resourceManager.load({
|
|
10562
|
+
url: imagePath,
|
|
10563
|
+
type: imageLoaderType
|
|
10564
|
+
});
|
|
10565
|
+
});
|
|
10566
|
+
return Promise.all(texturePromises).catch(function(error) {
|
|
10567
|
+
reject(error);
|
|
10568
|
+
return [];
|
|
10569
|
+
});
|
|
10821
10570
|
};
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
var
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10571
|
+
LoaderUtils.loadTextureAtlas = function loadTextureAtlas(atlasPath, engine$1, reject) {
|
|
10572
|
+
var baseUrl = LoaderUtils.getBaseUrl(atlasPath);
|
|
10573
|
+
var resourceManager = engine$1.resourceManager;
|
|
10574
|
+
var atlasText;
|
|
10575
|
+
return resourceManager// @ts-ignore
|
|
10576
|
+
._request(atlasPath, {
|
|
10577
|
+
type: "text"
|
|
10578
|
+
}).then(function(text) {
|
|
10579
|
+
atlasText = text;
|
|
10580
|
+
var textureAtlas = new TextureAtlas(atlasText);
|
|
10581
|
+
var loadTexturePromises = textureAtlas.pages.map(function(page) {
|
|
10582
|
+
var textureUrl = baseUrl + page.name;
|
|
10583
|
+
return resourceManager.load({
|
|
10584
|
+
url: textureUrl,
|
|
10585
|
+
type: engine.AssetType.Texture2D
|
|
10586
|
+
});
|
|
10587
|
+
});
|
|
10588
|
+
return Promise.all(loadTexturePromises).then(function(textures) {
|
|
10589
|
+
return LoaderUtils.createTextureAtlas(atlasText, textures);
|
|
10590
|
+
});
|
|
10591
|
+
}).catch(function(err) {
|
|
10592
|
+
reject(new Error("Spine Atlas: " + atlasPath + " load error: " + err));
|
|
10593
|
+
return null;
|
|
10594
|
+
});
|
|
10595
|
+
};
|
|
10596
|
+
LoaderUtils.getBaseUrl = function getBaseUrl(url) {
|
|
10597
|
+
var isLocalPath = !/^(http|https|ftp):\/\/.*/i.test(url);
|
|
10598
|
+
if (isLocalPath) {
|
|
10599
|
+
var lastSlashIndex = url.lastIndexOf("/");
|
|
10600
|
+
if (lastSlashIndex === -1) {
|
|
10601
|
+
return "";
|
|
10602
|
+
}
|
|
10603
|
+
return url.substring(0, lastSlashIndex + 1);
|
|
10839
10604
|
} else {
|
|
10840
|
-
|
|
10605
|
+
var parsedUrl = new URL(url);
|
|
10606
|
+
var basePath = parsedUrl.origin + parsedUrl.pathname;
|
|
10607
|
+
return basePath.endsWith("/") ? basePath : basePath.substring(0, basePath.lastIndexOf("/") + 1);
|
|
10841
10608
|
}
|
|
10842
10609
|
};
|
|
10843
|
-
|
|
10844
|
-
this._usedElementCount = 0;
|
|
10845
|
-
};
|
|
10846
|
-
return ClearablePool;
|
|
10610
|
+
return LoaderUtils;
|
|
10847
10611
|
}();
|
|
10848
10612
|
|
|
10849
10613
|
var SourceAlpha = engine.BlendFactor.SourceAlpha, One = engine.BlendFactor.One, DestinationColor = engine.BlendFactor.DestinationColor, Zero = engine.BlendFactor.Zero, OneMinusSourceColor = engine.BlendFactor.OneMinusSourceColor, OneMinusSourceAlpha = engine.BlendFactor.OneMinusSourceAlpha;
|
|
10850
10614
|
var Add = engine.BlendOperation.Add;
|
|
10851
|
-
function setBlendMode(material, blendMode) {
|
|
10615
|
+
function setBlendMode(material, blendMode, premultipliedAlpha) {
|
|
10852
10616
|
var target = material.renderState.blendState.targetBlendState;
|
|
10853
10617
|
switch(blendMode){
|
|
10854
10618
|
case exports.BlendMode.Additive:
|
|
10855
|
-
target.sourceColorBlendFactor = SourceAlpha;
|
|
10619
|
+
target.sourceColorBlendFactor = premultipliedAlpha ? One : SourceAlpha;
|
|
10856
10620
|
target.destinationColorBlendFactor = One;
|
|
10857
10621
|
target.sourceAlphaBlendFactor = One;
|
|
10858
10622
|
target.destinationAlphaBlendFactor = One;
|
|
@@ -10873,7 +10637,7 @@ function setBlendMode(material, blendMode) {
|
|
|
10873
10637
|
target.colorBlendOperation = target.alphaBlendOperation = Add;
|
|
10874
10638
|
break;
|
|
10875
10639
|
default:
|
|
10876
|
-
target.sourceColorBlendFactor = SourceAlpha;
|
|
10640
|
+
target.sourceColorBlendFactor = premultipliedAlpha ? One : SourceAlpha;
|
|
10877
10641
|
target.destinationColorBlendFactor = OneMinusSourceAlpha;
|
|
10878
10642
|
target.sourceAlphaBlendFactor = One;
|
|
10879
10643
|
target.destinationAlphaBlendFactor = OneMinusSourceAlpha;
|
|
@@ -10895,71 +10659,101 @@ function getBlendMode(material) {
|
|
|
10895
10659
|
return exports.BlendMode.Normal;
|
|
10896
10660
|
}
|
|
10897
10661
|
|
|
10662
|
+
var ClearablePool = /*#__PURE__*/ function() {
|
|
10663
|
+
function ClearablePool(type) {
|
|
10664
|
+
this._usedElementCount = 0;
|
|
10665
|
+
this._type = type;
|
|
10666
|
+
this._elements = [];
|
|
10667
|
+
}
|
|
10668
|
+
var _proto = ClearablePool.prototype;
|
|
10669
|
+
_proto.get = function get() {
|
|
10670
|
+
var _this = this, usedElementCount = _this._usedElementCount, elements = _this._elements;
|
|
10671
|
+
this._usedElementCount++;
|
|
10672
|
+
if (elements.length === usedElementCount) {
|
|
10673
|
+
var element = new this._type();
|
|
10674
|
+
elements.push(element);
|
|
10675
|
+
return element;
|
|
10676
|
+
} else {
|
|
10677
|
+
return elements[usedElementCount];
|
|
10678
|
+
}
|
|
10679
|
+
};
|
|
10680
|
+
_proto.clear = function clear() {
|
|
10681
|
+
this._usedElementCount = 0;
|
|
10682
|
+
};
|
|
10683
|
+
return ClearablePool;
|
|
10684
|
+
}();
|
|
10685
|
+
|
|
10686
|
+
var ReturnablePool = /*#__PURE__*/ function() {
|
|
10687
|
+
function ReturnablePool(type, initializeCount) {
|
|
10688
|
+
if (initializeCount === void 0) initializeCount = 1;
|
|
10689
|
+
this._type = type;
|
|
10690
|
+
this._lastElementIndex = initializeCount - 1;
|
|
10691
|
+
var elements = this._elements = new Array(initializeCount);
|
|
10692
|
+
for(var i = 0; i < initializeCount; ++i){
|
|
10693
|
+
elements[i] = new type();
|
|
10694
|
+
}
|
|
10695
|
+
}
|
|
10696
|
+
var _proto = ReturnablePool.prototype;
|
|
10697
|
+
_proto.get = function get() {
|
|
10698
|
+
if (this._lastElementIndex < 0) {
|
|
10699
|
+
return new this._type();
|
|
10700
|
+
}
|
|
10701
|
+
return this._elements[this._lastElementIndex--];
|
|
10702
|
+
};
|
|
10703
|
+
_proto.return = function _return(element) {
|
|
10704
|
+
this._elements[++this._lastElementIndex] = element;
|
|
10705
|
+
};
|
|
10706
|
+
return ReturnablePool;
|
|
10707
|
+
}();
|
|
10708
|
+
|
|
10898
10709
|
var SubRenderItem = function SubRenderItem() {
|
|
10899
10710
|
};
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
var SpineGenerator = /*#__PURE__*/ function() {
|
|
10711
|
+
/**
|
|
10712
|
+
* @internal
|
|
10713
|
+
*/ var SpineGenerator = /*#__PURE__*/ function() {
|
|
10903
10714
|
function SpineGenerator() {
|
|
10904
|
-
this._clipper = new SkeletonClipping();
|
|
10905
|
-
this._subRenderItems = [];
|
|
10906
10715
|
this._separateSlots = new Map();
|
|
10716
|
+
this._subRenderItems = [];
|
|
10717
|
+
this._clipper = new SkeletonClipping();
|
|
10907
10718
|
this._separateSlotTextureMap = new Map();
|
|
10908
10719
|
}
|
|
10909
10720
|
var _proto = SpineGenerator.prototype;
|
|
10910
|
-
_proto.getMaxVertexCount = function getMaxVertexCount(skeletonData) {
|
|
10911
|
-
var uniqueAttachments = new Set();
|
|
10912
|
-
var skins = skeletonData.skins;
|
|
10913
|
-
var skinLen = skins.length;
|
|
10914
|
-
for(var i = 0; i < skinLen; i++){
|
|
10915
|
-
var skin = skins[i];
|
|
10916
|
-
this._collectUniqueAttachments(skin, uniqueAttachments);
|
|
10917
|
-
}
|
|
10918
|
-
return this._calculateTotalVertexCount(uniqueAttachments);
|
|
10919
|
-
};
|
|
10920
10721
|
_proto.buildPrimitive = function buildPrimitive(skeleton, renderer) {
|
|
10921
|
-
var
|
|
10722
|
+
var _indices = renderer._indices, _vertices = renderer._vertices, _localBounds = renderer._localBounds, _vertexCount = renderer._vertexCount, _subPrimitives = renderer._subPrimitives, engine = renderer.engine, zSpacing = renderer.zSpacing, premultipliedAlpha = renderer.premultipliedAlpha;
|
|
10723
|
+
_localBounds.min.set(Infinity, Infinity, Infinity);
|
|
10724
|
+
_localBounds.max.set(-Infinity, -Infinity, -Infinity);
|
|
10922
10725
|
var _this = this, _clipper = _this._clipper, _separateSlots = _this._separateSlots, _subRenderItems = _this._subRenderItems, _separateSlotTextureMap = _this._separateSlotTextureMap;
|
|
10923
|
-
var
|
|
10924
|
-
bounds.min.set(maxBoundsValue, maxBoundsValue, maxBoundsValue);
|
|
10925
|
-
bounds.max.set(minBoundsValue, minBoundsValue, minBoundsValue);
|
|
10926
|
-
var verticesLength = 0;
|
|
10927
|
-
var indicesLength = 0;
|
|
10928
|
-
var drawOrder = skeleton.drawOrder;
|
|
10929
|
-
var maxSlotCount = drawOrder.length;
|
|
10930
|
-
var engine = renderer.engine, _indices = renderer._indices, _vertices = renderer._vertices, _subPrimitives = renderer._subPrimitives;
|
|
10931
|
-
var tempVerts = SpineGenerator.tempVerts, tempTexture = SpineGenerator.tempTexture, tempBlendMode = SpineGenerator.tempBlendMode, subRenderItemPool = SpineGenerator.subRenderItemPool, subPrimitivePool = SpineGenerator.subPrimitivePool;
|
|
10726
|
+
var tempVerts = SpineGenerator.tempVerts, subRenderItemPool = SpineGenerator.subRenderItemPool, subPrimitivePool = SpineGenerator.subPrimitivePool, VERTEX_SIZE = SpineGenerator.VERTEX_SIZE;
|
|
10932
10727
|
_subRenderItems.length = 0;
|
|
10933
10728
|
subRenderItemPool.clear();
|
|
10934
|
-
var vertices = renderer._vertices;
|
|
10935
10729
|
var triangles;
|
|
10936
10730
|
var uvs;
|
|
10937
|
-
|
|
10731
|
+
var verticesLength = 0;
|
|
10732
|
+
var indicesLength = 0;
|
|
10938
10733
|
var start = 0;
|
|
10939
10734
|
var count = 0;
|
|
10940
10735
|
var blend = exports.BlendMode.Normal;
|
|
10941
10736
|
var texture = null;
|
|
10737
|
+
var tempBlendMode = null;
|
|
10738
|
+
var tempTexture = null;
|
|
10942
10739
|
var primitiveIndex = 0;
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
for(var slotIndex = 0; slotIndex < maxSlotCount; ++slotIndex){
|
|
10740
|
+
var drawOrder = skeleton.drawOrder;
|
|
10741
|
+
for(var slotIndex = 0, n = drawOrder.length; slotIndex < n; ++slotIndex){
|
|
10946
10742
|
var slot = drawOrder[slotIndex];
|
|
10947
10743
|
if (!slot.bone.active) {
|
|
10948
10744
|
_clipper.clipEndWithSlot(slot);
|
|
10949
10745
|
continue;
|
|
10950
10746
|
}
|
|
10951
10747
|
var attachment = slot.getAttachment();
|
|
10952
|
-
var attachmentColor = null;
|
|
10953
|
-
var z = zSpacing * slotIndex;
|
|
10954
|
-
var numFloats = 0;
|
|
10955
|
-
var isClipping = _clipper.isClipping();
|
|
10956
|
-
var vertexSize = isClipping ? 2 : SpineGenerator.VERTEX_SIZE;
|
|
10957
10748
|
if (!attachment) {
|
|
10958
|
-
|
|
10959
|
-
_clipper.clipEndWithSlot(slot);
|
|
10960
|
-
}
|
|
10749
|
+
_clipper.clipEndWithSlot(slot);
|
|
10961
10750
|
continue;
|
|
10962
10751
|
}
|
|
10752
|
+
var z = zSpacing * slotIndex;
|
|
10753
|
+
var isClipping = _clipper.isClipping();
|
|
10754
|
+
var numFloats = 0;
|
|
10755
|
+
var attachmentColor = null;
|
|
10756
|
+
var vertexSize = isClipping ? 2 : VERTEX_SIZE;
|
|
10963
10757
|
switch(attachment.constructor){
|
|
10964
10758
|
case RegionAttachment:
|
|
10965
10759
|
var regionAttachment = attachment;
|
|
@@ -10974,7 +10768,7 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
10974
10768
|
var meshAttachment = attachment;
|
|
10975
10769
|
attachmentColor = meshAttachment.color;
|
|
10976
10770
|
numFloats = (meshAttachment.worldVerticesLength >> 1) * vertexSize;
|
|
10977
|
-
if (numFloats >
|
|
10771
|
+
if (numFloats > _vertices.length) {
|
|
10978
10772
|
SpineGenerator.tempVerts = new Array(numFloats);
|
|
10979
10773
|
}
|
|
10980
10774
|
meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, tempVerts, 0, vertexSize);
|
|
@@ -10983,15 +10777,11 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
10983
10777
|
texture = meshAttachment.region.texture;
|
|
10984
10778
|
break;
|
|
10985
10779
|
case ClippingAttachment:
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
_clipper.clipStart(slot, clip);
|
|
10989
|
-
}
|
|
10780
|
+
var clip = attachment;
|
|
10781
|
+
_clipper.clipStart(slot, clip);
|
|
10990
10782
|
continue;
|
|
10991
10783
|
default:
|
|
10992
|
-
|
|
10993
|
-
_clipper.clipEndWithSlot(slot);
|
|
10994
|
-
}
|
|
10784
|
+
_clipper.clipEndWithSlot(slot);
|
|
10995
10785
|
continue;
|
|
10996
10786
|
}
|
|
10997
10787
|
if (texture != null) {
|
|
@@ -11002,26 +10792,32 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
11002
10792
|
var _$skeleton = slot.bone.skeleton;
|
|
11003
10793
|
var skeletonColor = _$skeleton.color;
|
|
11004
10794
|
var slotColor = slot.color;
|
|
11005
|
-
var
|
|
11006
|
-
var
|
|
11007
|
-
|
|
11008
|
-
|
|
10795
|
+
var finalColor = SpineGenerator.tempColor;
|
|
10796
|
+
var finalAlpha = skeletonColor.a * slotColor.a * attachmentColor.a;
|
|
10797
|
+
finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;
|
|
10798
|
+
finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;
|
|
10799
|
+
finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;
|
|
10800
|
+
finalColor.a = finalAlpha;
|
|
10801
|
+
if (premultipliedAlpha) {
|
|
10802
|
+
finalColor.r *= finalAlpha;
|
|
10803
|
+
finalColor.g *= finalAlpha;
|
|
10804
|
+
finalColor.b *= finalAlpha;
|
|
10805
|
+
}
|
|
11009
10806
|
if (isClipping) {
|
|
11010
|
-
_clipper.clipTriangles(tempVerts, triangles, triangles.length, uvs,
|
|
10807
|
+
_clipper.clipTriangles(tempVerts, triangles, triangles.length, uvs, finalColor, SpineGenerator.tempDark, false);
|
|
11011
10808
|
finalVertices = _clipper.clippedVertices;
|
|
11012
10809
|
finalVerticesLength = finalVertices.length;
|
|
11013
10810
|
finalIndices = _clipper.clippedTriangles;
|
|
11014
10811
|
finalIndicesLength = finalIndices.length;
|
|
11015
10812
|
} else {
|
|
11016
|
-
var
|
|
11017
|
-
var
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
verts[v + 5] = uvs[u + 1];
|
|
10813
|
+
var r = finalColor.r, g = finalColor.g, b = finalColor.b, a = finalColor.a;
|
|
10814
|
+
for(var v = 2, u = 0, n1 = numFloats; v < n1; v += vertexSize, u += 2){
|
|
10815
|
+
tempVerts[v] = r;
|
|
10816
|
+
tempVerts[v + 1] = g;
|
|
10817
|
+
tempVerts[v + 2] = b;
|
|
10818
|
+
tempVerts[v + 3] = a;
|
|
10819
|
+
tempVerts[v + 4] = uvs[u];
|
|
10820
|
+
tempVerts[v + 5] = uvs[u + 1];
|
|
11025
10821
|
}
|
|
11026
10822
|
finalVertices = tempVerts;
|
|
11027
10823
|
finalVerticesLength = numFloats;
|
|
@@ -11033,48 +10829,37 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
11033
10829
|
continue;
|
|
11034
10830
|
}
|
|
11035
10831
|
var indexStart = verticesLength / SpineGenerator.VERTEX_STRIDE;
|
|
11036
|
-
var vertices1 = _vertices;
|
|
11037
10832
|
var i = verticesLength;
|
|
11038
10833
|
var j = 0;
|
|
11039
10834
|
for(; j < finalVerticesLength;){
|
|
11040
10835
|
var x = finalVertices[j++];
|
|
11041
10836
|
var y = finalVertices[j++];
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
this.
|
|
10837
|
+
_vertices[i++] = x;
|
|
10838
|
+
_vertices[i++] = y;
|
|
10839
|
+
_vertices[i++] = z;
|
|
10840
|
+
_vertices[i++] = finalVertices[j++];
|
|
10841
|
+
_vertices[i++] = finalVertices[j++];
|
|
10842
|
+
_vertices[i++] = finalVertices[j++];
|
|
10843
|
+
_vertices[i++] = finalVertices[j++];
|
|
10844
|
+
_vertices[i++] = finalVertices[j++];
|
|
10845
|
+
_vertices[i++] = finalVertices[j++];
|
|
10846
|
+
this._expandBounds(x, y, z, _localBounds);
|
|
11052
10847
|
}
|
|
11053
10848
|
verticesLength = i;
|
|
11054
|
-
var indicesArray = _indices;
|
|
11055
10849
|
for(i = indicesLength, j = 0; j < finalIndicesLength; i++, j++){
|
|
11056
|
-
|
|
10850
|
+
_indices[i] = finalIndices[j] + indexStart;
|
|
11057
10851
|
}
|
|
11058
10852
|
indicesLength += finalIndicesLength;
|
|
11059
10853
|
var slotData = slot.data;
|
|
11060
10854
|
var slotName = slotData.name;
|
|
11061
|
-
blend = slotData.blendMode;
|
|
11062
|
-
var blendModeChanged = tempBlendMode !== null && tempBlendMode !== slotData.blendMode;
|
|
11063
10855
|
var textureChanged = tempTexture !== null && tempTexture !== texture;
|
|
11064
10856
|
var slotNeedSeparate = _separateSlots.get(slotName);
|
|
10857
|
+
blend = slotData.blendMode;
|
|
10858
|
+
var blendModeChanged = tempBlendMode !== null && tempBlendMode !== blend;
|
|
11065
10859
|
if (slotNeedSeparate || blendModeChanged || textureChanged) {
|
|
11066
10860
|
// Finish accumulated count first
|
|
11067
10861
|
if (count > 0) {
|
|
11068
|
-
|
|
11069
|
-
origin && primitiveIndex++;
|
|
11070
|
-
var subPrimitive = origin || subPrimitivePool.get();
|
|
11071
|
-
subPrimitive.start = start;
|
|
11072
|
-
subPrimitive.count = count;
|
|
11073
|
-
var renderItem = subRenderItemPool.get();
|
|
11074
|
-
renderItem.subPrimitive = subPrimitive;
|
|
11075
|
-
renderItem.texture = tempTexture;
|
|
11076
|
-
renderItem.blendMode = tempBlendMode;
|
|
11077
|
-
_subRenderItems.push(renderItem);
|
|
10862
|
+
primitiveIndex = this._createRenderItem(_subPrimitives, primitiveIndex, start, count, tempTexture, tempBlendMode);
|
|
11078
10863
|
start += count;
|
|
11079
10864
|
count = 0;
|
|
11080
10865
|
}
|
|
@@ -11082,22 +10867,12 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
11082
10867
|
// If separatedTexture exist, set texture params
|
|
11083
10868
|
var separateTexture = _separateSlotTextureMap.get(slotName);
|
|
11084
10869
|
if (separateTexture) {
|
|
11085
|
-
var oldTexture = texture.
|
|
10870
|
+
var oldTexture = texture.getImage();
|
|
11086
10871
|
separateTexture.filterMode = oldTexture.filterMode;
|
|
11087
10872
|
separateTexture.wrapModeU = oldTexture.wrapModeU;
|
|
11088
10873
|
separateTexture.wrapModeV = oldTexture.wrapModeV;
|
|
11089
10874
|
}
|
|
11090
|
-
|
|
11091
|
-
origin1 && primitiveIndex++;
|
|
11092
|
-
var subPrimitive1 = origin1 || subPrimitivePool.get();
|
|
11093
|
-
subPrimitive1.start = start;
|
|
11094
|
-
subPrimitive1.count = finalIndicesLength;
|
|
11095
|
-
var renderItem1 = subRenderItemPool.get();
|
|
11096
|
-
renderItem1.blendMode = blend;
|
|
11097
|
-
renderItem1.subPrimitive = subPrimitive1;
|
|
11098
|
-
renderItem1.texture = texture;
|
|
11099
|
-
renderItem1.slotName = slotName;
|
|
11100
|
-
_subRenderItems.push(renderItem1);
|
|
10875
|
+
primitiveIndex = this._createRenderItem(_subPrimitives, primitiveIndex, start, finalIndicesLength, texture, blend, slotName);
|
|
11101
10876
|
start += finalIndicesLength;
|
|
11102
10877
|
count = 0;
|
|
11103
10878
|
} else {
|
|
@@ -11113,44 +10888,36 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
11113
10888
|
} // slot traverse end
|
|
11114
10889
|
// add reset sub primitive
|
|
11115
10890
|
if (count > 0) {
|
|
11116
|
-
|
|
11117
|
-
origin2 && primitiveIndex++;
|
|
11118
|
-
var subPrimitive2 = origin2 || subPrimitivePool.get();
|
|
11119
|
-
subPrimitive2.start = start;
|
|
11120
|
-
subPrimitive2.count = count;
|
|
11121
|
-
var renderItem2 = subRenderItemPool.get();
|
|
11122
|
-
renderItem2.blendMode = blend;
|
|
11123
|
-
renderItem2.subPrimitive = subPrimitive2;
|
|
11124
|
-
renderItem2.texture = texture;
|
|
11125
|
-
_subRenderItems.push(renderItem2);
|
|
10891
|
+
primitiveIndex = this._createRenderItem(_subPrimitives, primitiveIndex, start, count, texture, blend);
|
|
11126
10892
|
count = 0;
|
|
11127
10893
|
}
|
|
11128
10894
|
_clipper.clipEnd();
|
|
11129
10895
|
var lastLen = _subPrimitives.length;
|
|
11130
10896
|
var curLen = _subRenderItems.length;
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
subPrimitivePool.return(item);
|
|
11135
|
-
}
|
|
10897
|
+
for(var i1 = curLen; i1 < lastLen; i1++){
|
|
10898
|
+
var item = _subPrimitives[i1];
|
|
10899
|
+
subPrimitivePool.return(item);
|
|
11136
10900
|
}
|
|
11137
10901
|
renderer._clearSubPrimitives();
|
|
10902
|
+
var materialCache = SpineAnimationRenderer._materialCache;
|
|
11138
10903
|
for(var i2 = 0, l = curLen; i2 < l; ++i2){
|
|
11139
10904
|
var item1 = _subRenderItems[i2];
|
|
11140
10905
|
var slotName1 = item1.slotName, blendMode = item1.blendMode, texture1 = item1.texture;
|
|
11141
10906
|
renderer._addSubPrimitive(item1.subPrimitive);
|
|
11142
|
-
var subTexture = texture1.
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
}
|
|
11146
|
-
var key = subTexture.instanceId + "_" + blendMode;
|
|
11147
|
-
var material = SpineAnimationRenderer._materialCache.get(key);
|
|
10907
|
+
var subTexture = _separateSlotTextureMap.get(slotName1) || texture1.getImage();
|
|
10908
|
+
var key = subTexture.instanceId + "_" + blendMode + "_" + premultipliedAlpha;
|
|
10909
|
+
var material = materialCache.get(key);
|
|
11148
10910
|
if (!material) {
|
|
11149
|
-
material = this._createMaterialForTexture(subTexture, engine, blendMode);
|
|
11150
|
-
|
|
10911
|
+
material = this._createMaterialForTexture(subTexture, engine, blendMode, premultipliedAlpha);
|
|
10912
|
+
materialCache.set(key, material);
|
|
11151
10913
|
}
|
|
11152
10914
|
renderer.setMaterial(i2, material);
|
|
11153
10915
|
}
|
|
10916
|
+
if (indicesLength > _vertexCount) {
|
|
10917
|
+
renderer._createAndBindBuffer(indicesLength);
|
|
10918
|
+
this.buildPrimitive(skeleton, renderer);
|
|
10919
|
+
return;
|
|
10920
|
+
}
|
|
11154
10921
|
renderer._vertexBuffer.setData(_vertices);
|
|
11155
10922
|
renderer._indexBuffer.setData(_indices);
|
|
11156
10923
|
};
|
|
@@ -11160,49 +10927,41 @@ var SpineGenerator = /*#__PURE__*/ function() {
|
|
|
11160
10927
|
_proto.addSeparateSlotTexture = function addSeparateSlotTexture(slotName, texture) {
|
|
11161
10928
|
this._separateSlotTextureMap.set(slotName, texture);
|
|
11162
10929
|
};
|
|
11163
|
-
_proto._createMaterialForTexture = function _createMaterialForTexture(texture, engine, blendMode) {
|
|
10930
|
+
_proto._createMaterialForTexture = function _createMaterialForTexture(texture, engine, blendMode, premultipliedAlpha) {
|
|
11164
10931
|
var material = SpineAnimationRenderer._getDefaultMaterial(engine);
|
|
11165
10932
|
material.shaderData.setTexture("material_SpineTexture", texture);
|
|
11166
|
-
setBlendMode(material, blendMode);
|
|
10933
|
+
setBlendMode(material, blendMode, premultipliedAlpha);
|
|
11167
10934
|
return material;
|
|
11168
10935
|
};
|
|
11169
|
-
_proto.
|
|
11170
|
-
var
|
|
11171
|
-
var
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
var
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
}
|
|
11191
|
-
};
|
|
11192
|
-
_proto._calculateTotalVertexCount = function _calculateTotalVertexCount(uniqueAttachments) {
|
|
11193
|
-
var totalVertexCount = 0;
|
|
11194
|
-
var QUAD_TRIANGLE_LENGTH = SpineGenerator.QUAD_TRIANGLES.length;
|
|
11195
|
-
uniqueAttachments.forEach(function(attachment) {
|
|
11196
|
-
if (_instanceof1(attachment, RegionAttachment)) {
|
|
11197
|
-
totalVertexCount += QUAD_TRIANGLE_LENGTH;
|
|
11198
|
-
} else if (_instanceof1(attachment, MeshAttachment)) {
|
|
11199
|
-
totalVertexCount += attachment.triangles.length;
|
|
11200
|
-
}
|
|
11201
|
-
});
|
|
11202
|
-
return totalVertexCount;
|
|
10936
|
+
_proto._createRenderItem = function _createRenderItem(subPrimitives, primitiveIndex, start, count, texture, blend, slotName) {
|
|
10937
|
+
var subPrimitivePool = SpineGenerator.subPrimitivePool, subRenderItemPool = SpineGenerator.subRenderItemPool;
|
|
10938
|
+
var origin = subPrimitives[primitiveIndex];
|
|
10939
|
+
if (origin) {
|
|
10940
|
+
primitiveIndex++;
|
|
10941
|
+
}
|
|
10942
|
+
var subPrimitive = origin || subPrimitivePool.get();
|
|
10943
|
+
subPrimitive.start = start;
|
|
10944
|
+
subPrimitive.count = count;
|
|
10945
|
+
var renderItem = subRenderItemPool.get();
|
|
10946
|
+
renderItem.blendMode = blend;
|
|
10947
|
+
renderItem.subPrimitive = subPrimitive;
|
|
10948
|
+
renderItem.texture = texture;
|
|
10949
|
+
renderItem.slotName = slotName;
|
|
10950
|
+
this._subRenderItems.push(renderItem);
|
|
10951
|
+
return primitiveIndex;
|
|
10952
|
+
};
|
|
10953
|
+
_proto._expandBounds = function _expandBounds(x, y, z, localBounds) {
|
|
10954
|
+
var min = localBounds.min, max = localBounds.max;
|
|
10955
|
+
min.set(Math.min(min.x, x), Math.min(min.y, y), Math.min(min.z, z));
|
|
10956
|
+
max.set(Math.max(max.x, x), Math.max(max.y, y), Math.max(max.z, z));
|
|
11203
10957
|
};
|
|
11204
10958
|
return SpineGenerator;
|
|
11205
10959
|
}();
|
|
10960
|
+
SpineGenerator.VERTEX_SIZE = 8;
|
|
10961
|
+
SpineGenerator.VERTEX_STRIDE = 9;
|
|
10962
|
+
SpineGenerator.tempDark = new Color();
|
|
10963
|
+
SpineGenerator.tempColor = new Color();
|
|
10964
|
+
SpineGenerator.tempVerts = new Array(8);
|
|
11206
10965
|
SpineGenerator.QUAD_TRIANGLES = [
|
|
11207
10966
|
0,
|
|
11208
10967
|
1,
|
|
@@ -11211,18 +10970,8 @@ SpineGenerator.QUAD_TRIANGLES = [
|
|
|
11211
10970
|
3,
|
|
11212
10971
|
0
|
|
11213
10972
|
];
|
|
11214
|
-
SpineGenerator.VERTEX_SIZE = 8 // 2 2 4 position without z, uv, color
|
|
11215
|
-
;
|
|
11216
|
-
SpineGenerator.VERTEX_STRIDE = 9 // 3 2 4 position with z, uv, color
|
|
11217
|
-
;
|
|
11218
|
-
SpineGenerator.tempDark = new Color();
|
|
11219
|
-
SpineGenerator.tempColor = new Color();
|
|
11220
|
-
SpineGenerator.tempVerts = new Array(8);
|
|
11221
|
-
SpineGenerator.tempBlendMode = null;
|
|
11222
|
-
SpineGenerator.tempTexture = null;
|
|
11223
10973
|
SpineGenerator.subPrimitivePool = new ReturnablePool(engine.SubPrimitive);
|
|
11224
10974
|
SpineGenerator.subRenderItemPool = new ClearablePool(SubRenderItem);
|
|
11225
|
-
SpineGenerator.bounds = new engine.BoundingBox(new engine.Vector3(maxBoundsValue, maxBoundsValue, maxBoundsValue), new engine.Vector3(minBoundsValue, minBoundsValue, minBoundsValue));
|
|
11226
10975
|
|
|
11227
10976
|
var SpineMaterial = /*#__PURE__*/ function(Material) {
|
|
11228
10977
|
_inherits(SpineMaterial, Material);
|
|
@@ -11233,7 +10982,7 @@ var SpineMaterial = /*#__PURE__*/ function(Material) {
|
|
|
11233
10982
|
var renderState = _this.renderState;
|
|
11234
10983
|
var target = renderState.blendState.targetBlendState;
|
|
11235
10984
|
target.enabled = true;
|
|
11236
|
-
setBlendMode(_this, exports.BlendMode.Normal);
|
|
10985
|
+
setBlendMode(_this, exports.BlendMode.Normal, false);
|
|
11237
10986
|
renderState.depthState.writeEnabled = false;
|
|
11238
10987
|
renderState.rasterState.cullMode = engine.CullMode.Off;
|
|
11239
10988
|
renderState.renderQueueType = engine.RenderQueueType.Transparent;
|
|
@@ -11250,11 +10999,17 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11250
10999
|
_inherits(SpineAnimationRenderer, Renderer);
|
|
11251
11000
|
function SpineAnimationRenderer(entity) {
|
|
11252
11001
|
var _this;
|
|
11253
|
-
_this = Renderer.call(this, entity) || this, /**
|
|
11002
|
+
_this = Renderer.call(this, entity) || this, /**
|
|
11003
|
+
* The spacing between z layers in world units.
|
|
11004
|
+
*/ _this.zSpacing = 0.001, /**
|
|
11005
|
+
* Whether to use premultiplied alpha mode for rendering.
|
|
11006
|
+
* When enabled, vertex color values are multiplied by the alpha channel.
|
|
11007
|
+
* @remarks
|
|
11008
|
+
If this option is enabled, the Spine editor must export textures with "Premultiply Alpha" checked.
|
|
11009
|
+
*/ _this.premultipliedAlpha = false, /**
|
|
11254
11010
|
* Default state for spine animation.
|
|
11255
|
-
* Contains the default animation name to be played, whether this animation should loop,
|
|
11256
|
-
|
|
11257
|
-
*/ _this.defaultState = new DefaultState(), /** @internal */ _this._subPrimitives = [], /** @internal */ _this._needResizeBuffer = false, /** @internal */ _this._vertexCount = 0;
|
|
11011
|
+
* Contains the default animation name to be played, whether this animation should loop, the default skin name.
|
|
11012
|
+
*/ _this.defaultConfig = new SpineAnimationDefaultConfig(), /** @internal */ _this._subPrimitives = [], /** @internal */ _this._vertices = new Float32Array(), /** @internal */ _this._indices = new Uint16Array(), /** @internal */ _this._needResizeBuffer = false, /** @internal */ _this._vertexCount = 0, /** @internal */ _this._localBounds = new engine.BoundingBox(new engine.Vector3(Infinity, Infinity, Infinity), new engine.Vector3(-Infinity, -Infinity, -Infinity));
|
|
11258
11013
|
var primitive = new engine.Primitive(_this._engine);
|
|
11259
11014
|
_this._primitive = primitive;
|
|
11260
11015
|
primitive.addVertexElement(SpineAnimationRenderer._positionVertexElement);
|
|
@@ -11264,49 +11019,28 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11264
11019
|
}
|
|
11265
11020
|
var _proto = SpineAnimationRenderer.prototype;
|
|
11266
11021
|
/**
|
|
11267
|
-
* Separate slot by slot name. This will add a new sub primitive, and new materials.
|
|
11268
|
-
*/ _proto.addSeparateSlot = function addSeparateSlot(slotName) {
|
|
11269
|
-
if (!this._skeleton) {
|
|
11270
|
-
console.error("Skeleton not found!");
|
|
11271
|
-
}
|
|
11272
|
-
var slot = this._skeleton.findSlot(slotName);
|
|
11273
|
-
if (slot) {
|
|
11274
|
-
SpineAnimationRenderer._spineGenerator.addSeparateSlot(slotName);
|
|
11275
|
-
} else {
|
|
11276
|
-
console.warn("Slot: " + slotName + " not find.");
|
|
11277
|
-
}
|
|
11278
|
-
};
|
|
11279
|
-
/**
|
|
11280
11022
|
* @internal
|
|
11281
11023
|
*/ // @ts-ignore
|
|
11282
11024
|
_proto._onEnable = function _onEnable() {
|
|
11283
|
-
this.
|
|
11025
|
+
this._applyDefaultConfig();
|
|
11284
11026
|
};
|
|
11285
11027
|
/**
|
|
11286
11028
|
* @internal
|
|
11287
11029
|
*/ _proto.update = function update(delta) {
|
|
11288
|
-
var _this = this,
|
|
11289
|
-
if (
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
this._onWorldVolumeChanged();
|
|
11297
|
-
this._setDirtyFlagFalse(4);
|
|
11298
|
-
}
|
|
11299
|
-
if (this._isContainDirtyFlag(2)) {
|
|
11300
|
-
this._calculateGeneratorBounds(this.bounds);
|
|
11301
|
-
}
|
|
11302
|
-
}
|
|
11030
|
+
var _this = this, state = _this._state, skeleton = _this._skeleton;
|
|
11031
|
+
if (!state || !skeleton) return;
|
|
11032
|
+
state.update(delta);
|
|
11033
|
+
state.apply(skeleton);
|
|
11034
|
+
skeleton.update(delta);
|
|
11035
|
+
skeleton.updateWorldTransform(exports.Physics.update);
|
|
11036
|
+
SpineAnimationRenderer._spineGenerator.buildPrimitive(this._skeleton, this);
|
|
11037
|
+
this._dirtyUpdateFlag |= 1;
|
|
11303
11038
|
};
|
|
11304
11039
|
/**
|
|
11305
11040
|
* @internal
|
|
11306
11041
|
*/ // @ts-ignore
|
|
11307
11042
|
_proto._render = function _render(context) {
|
|
11308
|
-
var _this = this, _primitive = _this._primitive, _subPrimitives = _this._subPrimitives;
|
|
11309
|
-
var _this1 = this, materials = _this1._materials, engine = _this1._engine;
|
|
11043
|
+
var _this = this, _primitive = _this._primitive, _subPrimitives = _this._subPrimitives, materials = _this._materials, engine = _this._engine;
|
|
11310
11044
|
// @ts-ignore
|
|
11311
11045
|
var renderElement = engine._renderElementPool.get();
|
|
11312
11046
|
// @ts-ignore
|
|
@@ -11334,46 +11068,49 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11334
11068
|
* @internal
|
|
11335
11069
|
*/ // @ts-ignore
|
|
11336
11070
|
_proto._updateBounds = function _updateBounds(worldBounds) {
|
|
11337
|
-
this.
|
|
11071
|
+
engine.BoundingBox.transform(this._localBounds, this.entity.transform.worldMatrix, worldBounds);
|
|
11072
|
+
};
|
|
11073
|
+
/**
|
|
11074
|
+
* @internal
|
|
11075
|
+
*/ _proto._setSkeleton = function _setSkeleton(skeleton) {
|
|
11076
|
+
this._skeleton = skeleton;
|
|
11338
11077
|
};
|
|
11339
11078
|
/**
|
|
11340
11079
|
* @internal
|
|
11341
|
-
*/ _proto.
|
|
11342
|
-
|
|
11343
|
-
engine.BoundingBox.transform(bounds, this.entity.transform.worldMatrix, worldBounds);
|
|
11080
|
+
*/ _proto._setState = function _setState(state) {
|
|
11081
|
+
this._state = state;
|
|
11344
11082
|
};
|
|
11345
11083
|
/**
|
|
11346
11084
|
* @internal
|
|
11347
11085
|
*/ // @ts-ignore
|
|
11348
11086
|
_proto._cloneTo = function _cloneTo(target) {
|
|
11349
|
-
|
|
11087
|
+
var skeletonData = this._skeleton.data;
|
|
11088
|
+
var animationStateData = new AnimationStateData(skeletonData);
|
|
11089
|
+
var skeleton = new Skeleton(skeletonData);
|
|
11090
|
+
var state = new AnimationState(animationStateData);
|
|
11091
|
+
target._setSkeleton(skeleton);
|
|
11092
|
+
target._setState(state);
|
|
11350
11093
|
};
|
|
11351
11094
|
/**
|
|
11352
11095
|
* @internal
|
|
11353
11096
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
11354
|
-
var _this = this, _primitive = _this._primitive, _subPrimitives = _this._subPrimitives, _resource = _this._resource;
|
|
11355
|
-
_subPrimitives.length = 0;
|
|
11356
|
-
if (_primitive) {
|
|
11357
|
-
_primitive.destroy();
|
|
11358
|
-
}
|
|
11359
|
-
if (_resource) {
|
|
11360
|
-
this._addResourceReferCount(_resource, -1);
|
|
11361
|
-
}
|
|
11362
11097
|
this._clearMaterialCache();
|
|
11098
|
+
this._subPrimitives.length = 0;
|
|
11099
|
+
this._primitive && this._primitive.destroy();
|
|
11363
11100
|
this._primitive = null;
|
|
11364
11101
|
this._resource = null;
|
|
11365
11102
|
this._skeleton = null;
|
|
11366
11103
|
this._state = null;
|
|
11367
|
-
this.setting = null;
|
|
11368
11104
|
Renderer.prototype._onDestroy.call(this);
|
|
11369
11105
|
};
|
|
11370
11106
|
/**
|
|
11371
11107
|
* @internal
|
|
11372
|
-
*/ _proto.
|
|
11108
|
+
*/ _proto._createAndBindBuffer = function _createAndBindBuffer(vertexCount) {
|
|
11373
11109
|
var _this = this, _engine = _this._engine, _primitive = _this._primitive;
|
|
11110
|
+
this._vertexCount = vertexCount;
|
|
11374
11111
|
this._vertices = new Float32Array(vertexCount * SpineGenerator.VERTEX_STRIDE);
|
|
11375
11112
|
this._indices = new Uint16Array(vertexCount);
|
|
11376
|
-
var vertexStride = SpineGenerator.VERTEX_STRIDE * 4;
|
|
11113
|
+
var vertexStride = SpineGenerator.VERTEX_STRIDE * 4;
|
|
11377
11114
|
var vertexBuffer = new engine.Buffer(_engine, engine.BufferBindFlag.VertexBuffer, this._vertices, engine.BufferUsage.Dynamic);
|
|
11378
11115
|
var indexBuffer = new engine.Buffer(_engine, engine.BufferBindFlag.IndexBuffer, this._indices, engine.BufferUsage.Dynamic);
|
|
11379
11116
|
this._indexBuffer = indexBuffer;
|
|
@@ -11393,44 +11130,22 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11393
11130
|
*/ _proto._clearSubPrimitives = function _clearSubPrimitives() {
|
|
11394
11131
|
this._subPrimitives.length = 0;
|
|
11395
11132
|
};
|
|
11396
|
-
/**
|
|
11397
|
-
* @internal
|
|
11398
|
-
*/ _proto._isContainDirtyFlag = function _isContainDirtyFlag(type) {
|
|
11399
|
-
return (this._dirtyUpdateFlag & type) != 0;
|
|
11400
|
-
};
|
|
11401
|
-
/**
|
|
11402
|
-
* @internal
|
|
11403
|
-
*/ _proto._setDirtyFlagFalse = function _setDirtyFlagFalse(type) {
|
|
11404
|
-
this._dirtyUpdateFlag &= ~type;
|
|
11405
|
-
};
|
|
11406
|
-
/**
|
|
11407
|
-
* @internal
|
|
11408
|
-
*/ _proto._onWorldVolumeChanged = function _onWorldVolumeChanged() {
|
|
11409
|
-
this._dirtyUpdateFlag |= 1;
|
|
11410
|
-
};
|
|
11411
|
-
_proto._onAnimationStart = function _onAnimationStart() {
|
|
11412
|
-
this._dirtyUpdateFlag |= 2;
|
|
11413
|
-
};
|
|
11414
|
-
_proto._onAnimationComplete = function _onAnimationComplete(entry) {
|
|
11415
|
-
if (!entry.loop) {
|
|
11416
|
-
this._setDirtyFlagFalse(2);
|
|
11417
|
-
}
|
|
11418
|
-
};
|
|
11419
11133
|
_proto._clearMaterialCache = function _clearMaterialCache() {
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11134
|
+
var materialCache = SpineAnimationRenderer._materialCache;
|
|
11135
|
+
var _this = this, materials = _this._materials;
|
|
11136
|
+
for(var i = 0, len = materials.length; i < len; i += 1){
|
|
11137
|
+
var material = materials[i];
|
|
11138
|
+
var texture = material.shaderData.getTexture("material_SpineTexture");
|
|
11139
|
+
var blendMode = getBlendMode(material);
|
|
11423
11140
|
var key = texture.instanceId + "_" + blendMode;
|
|
11424
|
-
|
|
11425
|
-
}
|
|
11141
|
+
materialCache.delete(key);
|
|
11142
|
+
}
|
|
11426
11143
|
};
|
|
11427
|
-
_proto.
|
|
11144
|
+
_proto._applyDefaultConfig = function _applyDefaultConfig() {
|
|
11428
11145
|
var _this = this, skeleton = _this.skeleton, state = _this.state;
|
|
11429
11146
|
if (skeleton && state) {
|
|
11430
|
-
var
|
|
11431
|
-
|
|
11432
|
-
skeleton.scaleY = scale;
|
|
11433
|
-
if (skinName !== 'default') {
|
|
11147
|
+
var _this_defaultConfig = this.defaultConfig, animationName = _this_defaultConfig.animationName, skinName = _this_defaultConfig.skinName, loop = _this_defaultConfig.loop;
|
|
11148
|
+
if (skinName !== "default") {
|
|
11434
11149
|
skeleton.setSkinByName(skinName);
|
|
11435
11150
|
skeleton.setToSetupPose();
|
|
11436
11151
|
}
|
|
@@ -11455,51 +11170,11 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11455
11170
|
return defaultMaterial.clone();
|
|
11456
11171
|
};
|
|
11457
11172
|
_create_class(SpineAnimationRenderer, [
|
|
11458
|
-
{
|
|
11459
|
-
key: "resource",
|
|
11460
|
-
get: /**
|
|
11461
|
-
* Spine resource of current spine animation.This property allows you to switch between different animations at runtime.
|
|
11462
|
-
*/ function get() {
|
|
11463
|
-
return this._resource;
|
|
11464
|
-
},
|
|
11465
|
-
set: function set(value) {
|
|
11466
|
-
var _this = this;
|
|
11467
|
-
if (!value) {
|
|
11468
|
-
this._state = null;
|
|
11469
|
-
this._skeleton = null;
|
|
11470
|
-
this._resource = null;
|
|
11471
|
-
return;
|
|
11472
|
-
}
|
|
11473
|
-
this._resource = value;
|
|
11474
|
-
// @ts-ignore
|
|
11475
|
-
this._addResourceReferCount(value, 1);
|
|
11476
|
-
var skeletonData = value.skeletonData;
|
|
11477
|
-
this._skeleton = new Skeleton(skeletonData);
|
|
11478
|
-
var animationData = SpineAnimationRenderer._animationDataCache.get(skeletonData);
|
|
11479
|
-
if (!animationData) {
|
|
11480
|
-
animationData = new AnimationStateData(skeletonData);
|
|
11481
|
-
SpineAnimationRenderer._animationDataCache.set(skeletonData, animationData);
|
|
11482
|
-
}
|
|
11483
|
-
this._state = new AnimationState(animationData);
|
|
11484
|
-
var maxCount = SpineAnimationRenderer._spineGenerator.getMaxVertexCount(skeletonData);
|
|
11485
|
-
this._createBuffer(maxCount);
|
|
11486
|
-
this._initializeDefaultState();
|
|
11487
|
-
this._dirtyUpdateFlag |= 4;
|
|
11488
|
-
this._state.addListener({
|
|
11489
|
-
start: function() {
|
|
11490
|
-
_this._onAnimationStart();
|
|
11491
|
-
},
|
|
11492
|
-
complete: function(entry) {
|
|
11493
|
-
_this._onAnimationComplete(entry);
|
|
11494
|
-
}
|
|
11495
|
-
});
|
|
11496
|
-
}
|
|
11497
|
-
},
|
|
11498
11173
|
{
|
|
11499
11174
|
key: "state",
|
|
11500
11175
|
get: /**
|
|
11501
|
-
*
|
|
11502
|
-
*
|
|
11176
|
+
* The Spine.AnimationState object of this SpineAnimationRenderer.
|
|
11177
|
+
* Manage, blend, and transition between multiple simultaneous animations effectively.
|
|
11503
11178
|
*/ function get() {
|
|
11504
11179
|
return this._state;
|
|
11505
11180
|
}
|
|
@@ -11507,28 +11182,59 @@ SpineMaterial._spineFS = "\n uniform sampler2D material_SpineTexture;\n\n
|
|
|
11507
11182
|
{
|
|
11508
11183
|
key: "skeleton",
|
|
11509
11184
|
get: /**
|
|
11510
|
-
*
|
|
11511
|
-
*
|
|
11185
|
+
* The Spine.Skeleton object of this SpineAnimationRenderer.
|
|
11186
|
+
* Manipulate bone positions, rotations, scaling
|
|
11512
11187
|
* and change spine attachment to customize character appearances dynamically during runtime.
|
|
11513
11188
|
*/ function get() {
|
|
11514
11189
|
return this._skeleton;
|
|
11515
11190
|
}
|
|
11191
|
+
},
|
|
11192
|
+
{
|
|
11193
|
+
key: "resource",
|
|
11194
|
+
get: /**
|
|
11195
|
+
* * @deprecated This property is deprecated and will be removed in future releases.
|
|
11196
|
+
* Spine resource of current spine animation.
|
|
11197
|
+
*/ function get() {
|
|
11198
|
+
return this._resource;
|
|
11199
|
+
},
|
|
11200
|
+
set: /**
|
|
11201
|
+
* * @deprecated This property is deprecated and will be removed in future releases.
|
|
11202
|
+
* Sets the Spine resource for the current animation. This property allows switching to a different `SpineResource`.
|
|
11203
|
+
*
|
|
11204
|
+
* @param value - The new `SpineResource` to be used for the current animation
|
|
11205
|
+
*/ function set(value) {
|
|
11206
|
+
if (!value) {
|
|
11207
|
+
this._state = null;
|
|
11208
|
+
this._skeleton = null;
|
|
11209
|
+
this._resource = null;
|
|
11210
|
+
return;
|
|
11211
|
+
}
|
|
11212
|
+
this._resource = value;
|
|
11213
|
+
var skeletonData = value.skeletonData, stateData = value.stateData;
|
|
11214
|
+
var skeleton = new Skeleton(skeletonData);
|
|
11215
|
+
var state = new AnimationState(stateData);
|
|
11216
|
+
this._setSkeleton(skeleton);
|
|
11217
|
+
this._setState(state);
|
|
11218
|
+
this._applyDefaultConfig();
|
|
11219
|
+
}
|
|
11516
11220
|
}
|
|
11517
11221
|
]);
|
|
11518
11222
|
return SpineAnimationRenderer;
|
|
11519
11223
|
}(engine.Renderer);
|
|
11520
11224
|
SpineAnimationRenderer._spineGenerator = new SpineGenerator();
|
|
11521
|
-
SpineAnimationRenderer._positionVertexElement = new engine.VertexElement(
|
|
11522
|
-
SpineAnimationRenderer._colorVertexElement = new engine.VertexElement(
|
|
11523
|
-
SpineAnimationRenderer._uvVertexElement = new engine.VertexElement(
|
|
11225
|
+
SpineAnimationRenderer._positionVertexElement = new engine.VertexElement("POSITION", 0, engine.VertexElementFormat.Vector3, 0);
|
|
11226
|
+
SpineAnimationRenderer._colorVertexElement = new engine.VertexElement("COLOR_0", 12, engine.VertexElementFormat.Vector4, 0);
|
|
11227
|
+
SpineAnimationRenderer._uvVertexElement = new engine.VertexElement("TEXCOORD_0", 28, engine.VertexElementFormat.Vector2, 0);
|
|
11524
11228
|
/** @internal */ SpineAnimationRenderer._materialCache = new Map();
|
|
11525
|
-
/** @internal */ SpineAnimationRenderer._animationDataCache = new Map();
|
|
11526
11229
|
__decorate([
|
|
11527
|
-
engine.
|
|
11528
|
-
], SpineAnimationRenderer.prototype, "
|
|
11230
|
+
engine.assignmentClone
|
|
11231
|
+
], SpineAnimationRenderer.prototype, "zSpacing", void 0);
|
|
11232
|
+
__decorate([
|
|
11233
|
+
engine.assignmentClone
|
|
11234
|
+
], SpineAnimationRenderer.prototype, "premultipliedAlpha", void 0);
|
|
11529
11235
|
__decorate([
|
|
11530
11236
|
engine.deepClone
|
|
11531
|
-
], SpineAnimationRenderer.prototype, "
|
|
11237
|
+
], SpineAnimationRenderer.prototype, "defaultConfig", void 0);
|
|
11532
11238
|
__decorate([
|
|
11533
11239
|
engine.ignoreClone
|
|
11534
11240
|
], SpineAnimationRenderer.prototype, "_primitive", void 0);
|
|
@@ -11556,151 +11262,126 @@ __decorate([
|
|
|
11556
11262
|
__decorate([
|
|
11557
11263
|
engine.ignoreClone
|
|
11558
11264
|
], SpineAnimationRenderer.prototype, "_resource", void 0);
|
|
11265
|
+
__decorate([
|
|
11266
|
+
engine.ignoreClone
|
|
11267
|
+
], SpineAnimationRenderer.prototype, "_localBounds", void 0);
|
|
11559
11268
|
__decorate([
|
|
11560
11269
|
engine.ignoreClone
|
|
11561
11270
|
], SpineAnimationRenderer.prototype, "_skeleton", void 0);
|
|
11562
11271
|
__decorate([
|
|
11563
11272
|
engine.ignoreClone
|
|
11564
11273
|
], SpineAnimationRenderer.prototype, "_state", void 0);
|
|
11565
|
-
/**
|
|
11566
|
-
* Render setting for spine rendering.
|
|
11567
|
-
*/ var SpineRenderSetting = function SpineRenderSetting(/**
|
|
11568
|
-
* The spacing between z layers @defaultValue `0.01`
|
|
11569
|
-
*/ zSpacing, /**
|
|
11570
|
-
* Whether to use clipping @defaultValue `true`
|
|
11571
|
-
*/ useClipping) {
|
|
11572
|
-
if (zSpacing === void 0) zSpacing = 0.01;
|
|
11573
|
-
if (useClipping === void 0) useClipping = true;
|
|
11574
|
-
this.zSpacing = zSpacing;
|
|
11575
|
-
this.useClipping = useClipping;
|
|
11576
|
-
};
|
|
11577
11274
|
/**
|
|
11578
11275
|
* Default state for spine animation.
|
|
11579
11276
|
* Contains the default animation name to be played, whether this animation should loop,
|
|
11580
11277
|
* the default skin name, and the default scale of the skeleton.
|
|
11581
|
-
*/ var
|
|
11582
|
-
* The default scale of the animation @defaultValue `1`
|
|
11583
|
-
*/ scale, /**
|
|
11278
|
+
*/ var SpineAnimationDefaultConfig = function SpineAnimationDefaultConfig(/**
|
|
11584
11279
|
* Whether the default animation should loop @defaultValue `true. The default animation should loop`
|
|
11585
11280
|
*/ loop, /**
|
|
11586
11281
|
* The name of the default animation @defaultValue `null. Do not play any animation by default`
|
|
11587
11282
|
*/ animationName, /**
|
|
11588
11283
|
* The name of the default skin @defaultValue `default`
|
|
11589
11284
|
*/ skinName) {
|
|
11590
|
-
if (scale === void 0) scale = 1;
|
|
11591
11285
|
if (loop === void 0) loop = true;
|
|
11592
11286
|
if (animationName === void 0) animationName = null;
|
|
11593
11287
|
if (skinName === void 0) skinName = "default";
|
|
11594
|
-
this.scale = scale;
|
|
11595
11288
|
this.loop = loop;
|
|
11596
11289
|
this.animationName = animationName;
|
|
11597
11290
|
this.skinName = skinName;
|
|
11598
11291
|
};
|
|
11599
11292
|
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11293
|
+
/**
|
|
11294
|
+
* Represents a resource that manages Spine animation data, textures, and entity templates for the Galacean engine.
|
|
11295
|
+
*
|
|
11296
|
+
*/ var SpineResource = /*#__PURE__*/ function(ReferResource) {
|
|
11297
|
+
_inherits(SpineResource, ReferResource);
|
|
11298
|
+
function SpineResource(engine, skeletonData, url) {
|
|
11603
11299
|
var _this;
|
|
11604
|
-
_this = ReferResource.call(this, engine) || this, _this.
|
|
11300
|
+
_this = ReferResource.call(this, engine) || this, _this._texturesInSpineAtlas = [];
|
|
11301
|
+
_this.url = url;
|
|
11605
11302
|
_this._skeletonData = skeletonData;
|
|
11303
|
+
_this._stateData = new AnimationStateData(skeletonData);
|
|
11606
11304
|
_this._associationTextureInSkeletonData(skeletonData);
|
|
11305
|
+
_this._createTemplate();
|
|
11607
11306
|
return _this;
|
|
11608
11307
|
}
|
|
11609
|
-
var _proto =
|
|
11308
|
+
var _proto = SpineResource.prototype;
|
|
11309
|
+
/**
|
|
11310
|
+
* Creates and returns a new instance of the spine entity template.
|
|
11311
|
+
* @returns A instance of the spine entity template
|
|
11312
|
+
*/ _proto.instantiate = function instantiate() {
|
|
11313
|
+
return this._template.clone();
|
|
11314
|
+
};
|
|
11610
11315
|
_proto._onDestroy = function _onDestroy() {
|
|
11611
11316
|
ReferResource.prototype._onDestroy.call(this);
|
|
11612
|
-
|
|
11613
|
-
textures && this._disassociationSuperResource(textures);
|
|
11614
|
-
this._clearAttachmentTextures(_skeletonData);
|
|
11615
|
-
SpineAnimationRenderer._animationDataCache.delete(_skeletonData);
|
|
11317
|
+
this._disassociationSuperResource();
|
|
11616
11318
|
this._skeletonData = null;
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11319
|
+
this._stateData = null;
|
|
11320
|
+
};
|
|
11321
|
+
_proto._createTemplate = function _createTemplate() {
|
|
11322
|
+
var name = this._extractFileName(this.url);
|
|
11323
|
+
var spineEntity = new engine.Entity(this.engine, name);
|
|
11324
|
+
var spineAnimationRenderer = spineEntity.addComponent(SpineAnimationRenderer);
|
|
11325
|
+
var skeleton = new Skeleton(this._skeletonData);
|
|
11326
|
+
var state = new AnimationState(this._stateData);
|
|
11327
|
+
spineAnimationRenderer._setSkeleton(skeleton);
|
|
11328
|
+
spineAnimationRenderer._setState(state);
|
|
11329
|
+
// @ts-ignore
|
|
11330
|
+
spineEntity._markAsTemplate(this);
|
|
11331
|
+
this._template = spineEntity;
|
|
11623
11332
|
};
|
|
11624
11333
|
_proto._associationTextureInSkeletonData = function _associationTextureInSkeletonData(skeletonData) {
|
|
11625
|
-
var
|
|
11626
|
-
var
|
|
11627
|
-
skins.
|
|
11628
|
-
var
|
|
11629
|
-
attachments.forEach(function(attachmentMap) {
|
|
11334
|
+
var skins = skeletonData.skins, slots = skeletonData.slots;
|
|
11335
|
+
var textures = this._texturesInSpineAtlas;
|
|
11336
|
+
for(var i = 0, n = skins.length; i < n; i++){
|
|
11337
|
+
for(var j = 0, m = slots.length; j < m; j++){
|
|
11630
11338
|
var _attachment_region;
|
|
11631
|
-
var
|
|
11632
|
-
|
|
11339
|
+
var slot = slots[j];
|
|
11340
|
+
var attachment = skins[i].getAttachment(slot.index, slot.name);
|
|
11633
11341
|
var texture = attachment == null ? void 0 : (_attachment_region = attachment.region) == null ? void 0 : _attachment_region.texture.texture;
|
|
11634
|
-
if (texture
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11342
|
+
if (texture) {
|
|
11343
|
+
if (!textures.includes(texture)) {
|
|
11344
|
+
textures.push(texture);
|
|
11345
|
+
// @ts-ignore
|
|
11346
|
+
texture._associationSuperResource(this);
|
|
11347
|
+
}
|
|
11639
11348
|
}
|
|
11640
|
-
}
|
|
11641
|
-
}
|
|
11349
|
+
}
|
|
11350
|
+
}
|
|
11642
11351
|
};
|
|
11643
|
-
_proto.
|
|
11644
|
-
var
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
|
|
11654
|
-
}
|
|
11655
|
-
});
|
|
11656
|
-
});
|
|
11352
|
+
_proto._disassociationSuperResource = function _disassociationSuperResource() {
|
|
11353
|
+
var textures = this._texturesInSpineAtlas;
|
|
11354
|
+
for(var i = 0, n = textures.length; i < n; i++){
|
|
11355
|
+
// @ts-ignore
|
|
11356
|
+
textures[i]._disassociationSuperResource(this);
|
|
11357
|
+
}
|
|
11358
|
+
};
|
|
11359
|
+
_proto._extractFileName = function _extractFileName(url) {
|
|
11360
|
+
if (!url) return "Spine Entity";
|
|
11361
|
+
var match = url.match(/\/([^\/]+?)(\.[^\/]*)?$/);
|
|
11362
|
+
return match ? match[1] : "Spine Entity";
|
|
11657
11363
|
};
|
|
11658
|
-
_create_class(
|
|
11364
|
+
_create_class(SpineResource, [
|
|
11659
11365
|
{
|
|
11660
11366
|
key: "skeletonData",
|
|
11661
|
-
get:
|
|
11367
|
+
get: /**
|
|
11368
|
+
* The skeleton data associated with this Spine resource.
|
|
11369
|
+
*/ function get() {
|
|
11662
11370
|
return this._skeletonData;
|
|
11663
11371
|
}
|
|
11372
|
+
},
|
|
11373
|
+
{
|
|
11374
|
+
key: "stateData",
|
|
11375
|
+
get: /**
|
|
11376
|
+
* The animation state data associated with this Spine resource.
|
|
11377
|
+
*/ function get() {
|
|
11378
|
+
return this._stateData;
|
|
11379
|
+
}
|
|
11664
11380
|
}
|
|
11665
11381
|
]);
|
|
11666
|
-
return
|
|
11382
|
+
return SpineResource;
|
|
11667
11383
|
}(engine.ReferResource);
|
|
11668
11384
|
|
|
11669
|
-
var BufferReader = /*#__PURE__*/ function() {
|
|
11670
|
-
function BufferReader(data, byteOffset, byteLength) {
|
|
11671
|
-
if (byteOffset === void 0) byteOffset = 0;
|
|
11672
|
-
this.data = data;
|
|
11673
|
-
this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength != null ? byteLength : data.byteLength - byteOffset);
|
|
11674
|
-
this._position = 0;
|
|
11675
|
-
}
|
|
11676
|
-
var _proto = BufferReader.prototype;
|
|
11677
|
-
_proto.nextUint16 = function nextUint16() {
|
|
11678
|
-
var value = this._dataView.getUint16(this._position, true);
|
|
11679
|
-
this._position += 2;
|
|
11680
|
-
return value;
|
|
11681
|
-
};
|
|
11682
|
-
_proto.nextStr = function nextStr() {
|
|
11683
|
-
var strByteLength = this.nextUint16();
|
|
11684
|
-
var uint8Array = new Uint8Array(this.data.buffer, this._position + this._dataView.byteOffset, strByteLength);
|
|
11685
|
-
this._position += strByteLength;
|
|
11686
|
-
return this.decodeText(uint8Array);
|
|
11687
|
-
};
|
|
11688
|
-
_proto.nextImageData = function nextImageData() {
|
|
11689
|
-
return new Uint8Array(this.data.buffer, this.data.byteOffset + this._position);
|
|
11690
|
-
};
|
|
11691
|
-
_proto.decodeText = function decodeText(array) {
|
|
11692
|
-
if (typeof TextDecoder !== "undefined") {
|
|
11693
|
-
return new TextDecoder().decode(array);
|
|
11694
|
-
}
|
|
11695
|
-
var s = "";
|
|
11696
|
-
for(var i = 0, il = array.length; i < il; i++){
|
|
11697
|
-
s += String.fromCharCode(array[i]);
|
|
11698
|
-
}
|
|
11699
|
-
return decodeURIComponent(encodeURIComponent(s));
|
|
11700
|
-
};
|
|
11701
|
-
return BufferReader;
|
|
11702
|
-
}();
|
|
11703
|
-
|
|
11704
11385
|
var SpineLoader = /*#__PURE__*/ function(Loader) {
|
|
11705
11386
|
_inherits(SpineLoader, Loader);
|
|
11706
11387
|
function SpineLoader() {
|
|
@@ -11709,352 +11390,249 @@ var SpineLoader = /*#__PURE__*/ function(Loader) {
|
|
|
11709
11390
|
var _proto = SpineLoader.prototype;
|
|
11710
11391
|
_proto.load = function load(item, resourceManager) {
|
|
11711
11392
|
var _this = this;
|
|
11712
|
-
return new engine.AssetPromise(
|
|
11713
|
-
var
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
];
|
|
11721
|
-
return [
|
|
11722
|
-
4,
|
|
11723
|
-
_this._handleOriginAsset(item, resourceManager)
|
|
11724
|
-
];
|
|
11725
|
-
case 1:
|
|
11726
|
-
resource = _state.sent();
|
|
11727
|
-
return [
|
|
11728
|
-
3,
|
|
11729
|
-
7
|
|
11730
|
-
];
|
|
11731
|
-
case 2:
|
|
11732
|
-
return [
|
|
11733
|
-
4,
|
|
11734
|
-
resourceManager._request(item.url, {
|
|
11735
|
-
type: 'arraybuffer'
|
|
11736
|
-
})
|
|
11737
|
-
];
|
|
11738
|
-
case 3:
|
|
11739
|
-
buffer = _state.sent();
|
|
11740
|
-
reader = new BufferReader(new Uint8Array(buffer));
|
|
11741
|
-
header = reader.nextStr();
|
|
11742
|
-
if (!header.startsWith('spine')) return [
|
|
11743
|
-
3,
|
|
11744
|
-
5
|
|
11745
|
-
];
|
|
11746
|
-
return [
|
|
11747
|
-
4,
|
|
11748
|
-
_this._handleEditorAsset(buffer, reader, header, resourceManager)
|
|
11749
|
-
];
|
|
11750
|
-
case 4:
|
|
11751
|
-
resource = _state.sent();
|
|
11752
|
-
return [
|
|
11753
|
-
3,
|
|
11754
|
-
7
|
|
11755
|
-
];
|
|
11756
|
-
case 5:
|
|
11757
|
-
return [
|
|
11758
|
-
4,
|
|
11759
|
-
_this._handleOriginAsset(item, resourceManager, buffer)
|
|
11760
|
-
];
|
|
11761
|
-
case 6:
|
|
11762
|
-
resource = _state.sent();
|
|
11763
|
-
_state.label = 7;
|
|
11764
|
-
case 7:
|
|
11765
|
-
resolve(resource);
|
|
11766
|
-
return [
|
|
11767
|
-
2
|
|
11768
|
-
];
|
|
11769
|
-
}
|
|
11770
|
-
});
|
|
11771
|
-
}));
|
|
11772
|
-
};
|
|
11773
|
-
_proto._handleEditorAsset = function _handleEditorAsset(buffer, reader, header, resourceManager) {
|
|
11774
|
-
return _async_to_generator(function() {
|
|
11775
|
-
var skeletonRawData, atlasRefId, type, engine, decoder, text, _JSON_parse, data, atlas, textureAtlas, skeletonData;
|
|
11776
|
-
return __generator(this, function(_state) {
|
|
11777
|
-
switch(_state.label){
|
|
11778
|
-
case 0:
|
|
11779
|
-
type = header.startsWith('spine:skel') ? 'skel' : 'json';
|
|
11780
|
-
engine = resourceManager.engine;
|
|
11781
|
-
if (type === 'skel') {
|
|
11782
|
-
atlasRefId = reader.nextStr();
|
|
11783
|
-
skeletonRawData = reader.nextImageData().buffer;
|
|
11784
|
-
} else {
|
|
11785
|
-
decoder = new TextDecoder('utf-8');
|
|
11786
|
-
text = decoder.decode(new Uint8Array(buffer));
|
|
11787
|
-
_JSON_parse = JSON.parse(text), data = _JSON_parse.data, atlas = _JSON_parse.atlas;
|
|
11788
|
-
atlasRefId = atlas.refId;
|
|
11789
|
-
skeletonRawData = data;
|
|
11790
|
-
}
|
|
11791
|
-
return [
|
|
11792
|
-
4,
|
|
11793
|
-
resourceManager.getResourceByRef({
|
|
11794
|
-
refId: atlasRefId
|
|
11795
|
-
})
|
|
11796
|
-
];
|
|
11797
|
-
case 1:
|
|
11798
|
-
textureAtlas = _state.sent();
|
|
11799
|
-
skeletonData = createSkeletonData(textureAtlas, skeletonRawData, type);
|
|
11800
|
-
return [
|
|
11801
|
-
2,
|
|
11802
|
-
new SkeletonDataResource(engine, skeletonData)
|
|
11803
|
-
];
|
|
11393
|
+
return new engine.AssetPromise(function(resolve, reject) {
|
|
11394
|
+
var spineLoadContext = {
|
|
11395
|
+
fileName: "",
|
|
11396
|
+
skeletonRawData: "",
|
|
11397
|
+
spineAssetPath: {
|
|
11398
|
+
atlasPath: null,
|
|
11399
|
+
skeletonPath: null,
|
|
11400
|
+
extraPaths: []
|
|
11804
11401
|
}
|
|
11805
|
-
}
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
case 0:
|
|
11815
|
-
fileExtensions = (item.params || {}).fileExtensions;
|
|
11816
|
-
spineAssetBundle = {
|
|
11817
|
-
skeletonPath: '',
|
|
11818
|
-
skeletonExtension: '',
|
|
11819
|
-
atlasPath: '',
|
|
11820
|
-
imagePaths: [],
|
|
11821
|
-
imageExtensions: []
|
|
11822
|
-
};
|
|
11823
|
-
engine = resourceManager.engine;
|
|
11824
|
-
if (!buffer) return [
|
|
11825
|
-
3,
|
|
11826
|
-
2
|
|
11827
|
-
];
|
|
11828
|
-
fileExtension = SpineLoader.verifyFileExtensions(fileExtensions, false);
|
|
11829
|
-
SpineLoader.deriveAndAssignSpineAsset(item.url, fileExtension, spineAssetBundle);
|
|
11830
|
-
skeletonPath = spineAssetBundle.skeletonPath, atlasPath = spineAssetBundle.atlasPath;
|
|
11831
|
-
if (!skeletonPath || !atlasPath) {
|
|
11832
|
-
throw new Error('Failed to load spine assets. Please check the file path and ensure the file extension is included.');
|
|
11833
|
-
}
|
|
11834
|
-
return [
|
|
11835
|
-
4,
|
|
11836
|
-
loadTextureAtlas(atlasPath, engine)
|
|
11837
|
-
];
|
|
11838
|
-
case 1:
|
|
11839
|
-
textureAtlas = _state.sent();
|
|
11840
|
-
_this__determineSkeletonDataType = _this._determineSkeletonDataType(buffer), data = _this__determineSkeletonDataType.data, type = _this__determineSkeletonDataType.type;
|
|
11841
|
-
skeletonData = createSkeletonData(textureAtlas, data, type);
|
|
11842
|
-
return [
|
|
11843
|
-
2,
|
|
11844
|
-
new SkeletonDataResource(engine, skeletonData)
|
|
11845
|
-
];
|
|
11846
|
-
case 2:
|
|
11847
|
-
fileExtensions = SpineLoader.verifyFileExtensions(fileExtensions, true);
|
|
11848
|
-
for(i = 0; i < item.urls.length; i += 1){
|
|
11849
|
-
url = item.urls[i];
|
|
11850
|
-
extension = fileExtensions && fileExtensions[i] || null;
|
|
11851
|
-
SpineLoader.parseAndAssignSpineAsset(url, extension, spineAssetBundle);
|
|
11852
|
-
}
|
|
11853
|
-
skeletonPath1 = spineAssetBundle.skeletonPath, atlasPath1 = spineAssetBundle.atlasPath, imagePaths = spineAssetBundle.imagePaths, skeletonExtension = spineAssetBundle.skeletonExtension, imageExtensions = spineAssetBundle.imageExtensions;
|
|
11854
|
-
if (!skeletonPath1 || !atlasPath1) {
|
|
11855
|
-
throw new Error('Failed to load spine assets. Please check the file path and ensure the file extension is included.');
|
|
11856
|
-
}
|
|
11857
|
-
// @ts-ignore
|
|
11858
|
-
skeletonPromise = skeletonExtension === 'json' ? resourceManager._request(skeletonPath1, {
|
|
11859
|
-
type: 'text'
|
|
11860
|
-
}) : resourceManager._request(skeletonPath1, {
|
|
11861
|
-
type: 'arraybuffer'
|
|
11862
|
-
});
|
|
11863
|
-
type1 = skeletonExtension === 'json' ? 'json' : 'skel';
|
|
11864
|
-
loadQueue = [
|
|
11865
|
-
skeletonPromise
|
|
11866
|
-
];
|
|
11867
|
-
if (!(imagePaths.length > 0)) return [
|
|
11868
|
-
3,
|
|
11869
|
-
4
|
|
11870
|
-
];
|
|
11871
|
-
loadQueue = loadQueue.concat([
|
|
11872
|
-
// @ts-ignore
|
|
11873
|
-
resourceManager._request(atlasPath1, {
|
|
11874
|
-
type: 'text'
|
|
11875
|
-
}),
|
|
11876
|
-
loadTexturesByPath(imagePaths, imageExtensions, engine)
|
|
11877
|
-
]);
|
|
11878
|
-
return [
|
|
11879
|
-
4,
|
|
11880
|
-
Promise.all(loadQueue)
|
|
11881
|
-
];
|
|
11882
|
-
case 3:
|
|
11883
|
-
ref = _state.sent(), skeletonTextData = ref[0], atlasText = ref[1], textures = ref[2];
|
|
11884
|
-
textureAtlas1 = createTextureAtlas(atlasText, textures);
|
|
11885
|
-
return [
|
|
11886
|
-
3,
|
|
11887
|
-
6
|
|
11888
|
-
];
|
|
11889
|
-
case 4:
|
|
11890
|
-
loadQueue.push(loadTextureAtlas(atlasPath1, engine));
|
|
11891
|
-
return [
|
|
11892
|
-
4,
|
|
11893
|
-
Promise.all(loadQueue)
|
|
11894
|
-
];
|
|
11895
|
-
case 5:
|
|
11896
|
-
ref1 = _state.sent(), skeletonTextData = ref1[0], textureAtlas1 = ref1[1];
|
|
11897
|
-
_state.label = 6;
|
|
11898
|
-
case 6:
|
|
11899
|
-
skeletonData1 = createSkeletonData(textureAtlas1, skeletonTextData, type1);
|
|
11900
|
-
return [
|
|
11901
|
-
2,
|
|
11902
|
-
new SkeletonDataResource(engine, skeletonData1)
|
|
11903
|
-
];
|
|
11904
|
-
case 7:
|
|
11905
|
-
return [
|
|
11906
|
-
2
|
|
11907
|
-
];
|
|
11402
|
+
};
|
|
11403
|
+
var spineAssetPath = spineLoadContext.spineAssetPath;
|
|
11404
|
+
if (!item.urls) {
|
|
11405
|
+
SpineLoader._assignAssetPathsFromUrl(item.url, spineAssetPath, resourceManager);
|
|
11406
|
+
} else {
|
|
11407
|
+
var urls = item.urls;
|
|
11408
|
+
for(var i = 0, len = urls.length; i < len; i += 1){
|
|
11409
|
+
var url = urls[i];
|
|
11410
|
+
SpineLoader._groupAssetsByExtension(url, spineAssetPath);
|
|
11908
11411
|
}
|
|
11909
|
-
}
|
|
11910
|
-
|
|
11412
|
+
}
|
|
11413
|
+
var skeletonPath = spineAssetPath.skeletonPath, atlasPath = spineAssetPath.atlasPath;
|
|
11414
|
+
if (!skeletonPath || !atlasPath) {
|
|
11415
|
+
reject(new Error("Failed to load spine assets. Please check the file path and ensure the file extension is included."));
|
|
11416
|
+
return;
|
|
11417
|
+
}
|
|
11418
|
+
resourceManager// @ts-ignore
|
|
11419
|
+
._request(skeletonPath, {
|
|
11420
|
+
type: "arraybuffer"
|
|
11421
|
+
}).then(function(skeletonRawData) {
|
|
11422
|
+
spineLoadContext.skeletonRawData = skeletonRawData;
|
|
11423
|
+
var skeletonString = SpineLoader._decoder.decode(skeletonRawData);
|
|
11424
|
+
if (skeletonString.startsWith("{")) {
|
|
11425
|
+
spineLoadContext.skeletonRawData = skeletonString;
|
|
11426
|
+
}
|
|
11427
|
+
return _this._loadAndCreateSpineResource(spineLoadContext, resourceManager);
|
|
11428
|
+
}).then(resolve).catch(reject);
|
|
11429
|
+
});
|
|
11911
11430
|
};
|
|
11912
|
-
_proto.
|
|
11913
|
-
var
|
|
11914
|
-
var
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
type
|
|
11924
|
-
}
|
|
11925
|
-
return {
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
};
|
|
11431
|
+
_proto._loadAndCreateSpineResource = function _loadAndCreateSpineResource(spineLoadContext, resourceManager) {
|
|
11432
|
+
var engine = resourceManager.engine;
|
|
11433
|
+
var skeletonRawData = spineLoadContext.skeletonRawData, spineAssetPath = spineLoadContext.spineAssetPath;
|
|
11434
|
+
var skeletonPath = spineAssetPath.skeletonPath, atlasPath = spineAssetPath.atlasPath, extraPaths = spineAssetPath.extraPaths;
|
|
11435
|
+
var atlasLoadPromise = extraPaths.length === 0 ? resourceManager.load({
|
|
11436
|
+
url: atlasPath,
|
|
11437
|
+
type: "SpineAtlas"
|
|
11438
|
+
}) : resourceManager.load({
|
|
11439
|
+
urls: [
|
|
11440
|
+
atlasPath
|
|
11441
|
+
].concat(extraPaths),
|
|
11442
|
+
type: "SpineAtlas"
|
|
11443
|
+
});
|
|
11444
|
+
return atlasLoadPromise.then(function(textureAtlas) {
|
|
11445
|
+
var skeletonData = LoaderUtils.createSkeletonData(skeletonRawData, textureAtlas, 0.01);
|
|
11446
|
+
return new SpineResource(engine, skeletonData, skeletonPath);
|
|
11447
|
+
});
|
|
11929
11448
|
};
|
|
11930
|
-
SpineLoader.
|
|
11931
|
-
var
|
|
11932
|
-
var ext = SpineLoader.getUrlExtension(url, fileExtension);
|
|
11449
|
+
SpineLoader._groupAssetsByExtension = function _groupAssetsByExtension(url, assetPath) {
|
|
11450
|
+
var ext = SpineLoader._getUrlExtension(url);
|
|
11933
11451
|
if (!ext) return;
|
|
11934
|
-
if (
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
}
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11452
|
+
if ([
|
|
11453
|
+
"skel",
|
|
11454
|
+
"json",
|
|
11455
|
+
"bin"
|
|
11456
|
+
].includes(ext)) {
|
|
11457
|
+
assetPath.skeletonPath = url;
|
|
11458
|
+
} else if (ext === "atlas") {
|
|
11459
|
+
assetPath.atlasPath = url;
|
|
11460
|
+
} else {
|
|
11461
|
+
assetPath.extraPaths.push(url);
|
|
11944
11462
|
}
|
|
11945
11463
|
};
|
|
11946
|
-
SpineLoader.
|
|
11947
|
-
var
|
|
11464
|
+
SpineLoader._assignAssetPathsFromUrl = function _assignAssetPathsFromUrl(url, assetPath, resourceManager) {
|
|
11465
|
+
var _resourceManager__virtualPathResourceMap_url, _resourceManager__virtualPathResourceMap;
|
|
11466
|
+
var ext = SpineLoader._getUrlExtension(url);
|
|
11948
11467
|
if (!ext) return;
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
var
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
console.error('Expect fileExtensions to be an array.');
|
|
11965
|
-
return [];
|
|
11966
|
-
} else if (!expectArray && typeof fileExtensions !== 'string') {
|
|
11967
|
-
console.error('Expect fileExtensions to be a string.');
|
|
11968
|
-
return null;
|
|
11468
|
+
assetPath.skeletonPath = url;
|
|
11469
|
+
// @ts-ignore
|
|
11470
|
+
var skeletonDependency = resourceManager == null ? void 0 : (_resourceManager__virtualPathResourceMap = resourceManager._virtualPathResourceMap) == null ? void 0 : (_resourceManager__virtualPathResourceMap_url = _resourceManager__virtualPathResourceMap[url]) == null ? void 0 : _resourceManager__virtualPathResourceMap_url.dependentAssetMap;
|
|
11471
|
+
if (skeletonDependency) {
|
|
11472
|
+
assetPath.atlasPath = skeletonDependency.atlas;
|
|
11473
|
+
} else {
|
|
11474
|
+
var extensionPattern = /\.(json|bin|skel)$/;
|
|
11475
|
+
var baseUrl;
|
|
11476
|
+
if (extensionPattern.test(url)) {
|
|
11477
|
+
baseUrl = url.replace(extensionPattern, "");
|
|
11478
|
+
}
|
|
11479
|
+
if (baseUrl) {
|
|
11480
|
+
var atlasUrl = baseUrl + ".atlas";
|
|
11481
|
+
assetPath.atlasPath = atlasUrl;
|
|
11482
|
+
}
|
|
11969
11483
|
}
|
|
11970
|
-
return fileExtensions;
|
|
11971
11484
|
};
|
|
11972
|
-
SpineLoader.
|
|
11973
|
-
|
|
11974
|
-
return fileExtension;
|
|
11975
|
-
}
|
|
11976
|
-
var regex = /\/([^\/?#]+)\.([a-zA-Z0-9]+)(\?|#|$)|\?[^#]*\.([a-zA-Z0-9]+)(\?|#|$)/;
|
|
11485
|
+
SpineLoader._getUrlExtension = function _getUrlExtension(url) {
|
|
11486
|
+
var regex = /\.(\w+)(\?|$)/;
|
|
11977
11487
|
var match = url.match(regex);
|
|
11978
|
-
|
|
11979
|
-
return match[2] || match[4];
|
|
11980
|
-
}
|
|
11981
|
-
return null;
|
|
11488
|
+
return match ? match[1] : null;
|
|
11982
11489
|
};
|
|
11983
11490
|
return SpineLoader;
|
|
11984
11491
|
}(engine.Loader);
|
|
11985
|
-
SpineLoader.
|
|
11986
|
-
"png",
|
|
11987
|
-
"jpg",
|
|
11988
|
-
"webp",
|
|
11989
|
-
"jpeg",
|
|
11990
|
-
"ktx",
|
|
11991
|
-
"ktx2"
|
|
11992
|
-
];
|
|
11993
|
-
SpineLoader.skeletonExtensions = [
|
|
11994
|
-
"skel",
|
|
11995
|
-
"json",
|
|
11996
|
-
"bin"
|
|
11997
|
-
];
|
|
11492
|
+
SpineLoader._decoder = new TextDecoder("utf-8");
|
|
11998
11493
|
SpineLoader = __decorate([
|
|
11999
|
-
engine.resourceLoader("
|
|
11494
|
+
engine.resourceLoader("Spine", [
|
|
12000
11495
|
"json",
|
|
12001
11496
|
"bin",
|
|
12002
11497
|
"skel"
|
|
12003
11498
|
])
|
|
12004
11499
|
], SpineLoader);
|
|
11500
|
+
var DeprecatedSpineLoader = /*#__PURE__*/ function(SpineLoader) {
|
|
11501
|
+
_inherits(DeprecatedSpineLoader, SpineLoader);
|
|
11502
|
+
function DeprecatedSpineLoader() {
|
|
11503
|
+
return SpineLoader.apply(this, arguments) || this;
|
|
11504
|
+
}
|
|
11505
|
+
return DeprecatedSpineLoader;
|
|
11506
|
+
}(SpineLoader);
|
|
11507
|
+
DeprecatedSpineLoader = __decorate([
|
|
11508
|
+
engine.resourceLoader("spine", [
|
|
11509
|
+
"json",
|
|
11510
|
+
"bin",
|
|
11511
|
+
"skel"
|
|
11512
|
+
])
|
|
11513
|
+
], DeprecatedSpineLoader);
|
|
12005
11514
|
|
|
12006
|
-
var
|
|
12007
|
-
_inherits(
|
|
12008
|
-
function
|
|
11515
|
+
var SpineAtlasLoader = /*#__PURE__*/ function(Loader) {
|
|
11516
|
+
_inherits(SpineAtlasLoader, Loader);
|
|
11517
|
+
function SpineAtlasLoader() {
|
|
12009
11518
|
return Loader.apply(this, arguments) || this;
|
|
12010
11519
|
}
|
|
12011
|
-
var _proto =
|
|
11520
|
+
var _proto = SpineAtlasLoader.prototype;
|
|
12012
11521
|
_proto.load = function load(item, resourceManager) {
|
|
12013
|
-
return new engine.AssetPromise(
|
|
12014
|
-
var
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
11522
|
+
return new engine.AssetPromise(function(resolve, reject) {
|
|
11523
|
+
var engine = resourceManager.engine;
|
|
11524
|
+
var spineAtlasAsset = {
|
|
11525
|
+
atlasPath: "",
|
|
11526
|
+
imagePaths: [],
|
|
11527
|
+
imageExtensions: []
|
|
11528
|
+
};
|
|
11529
|
+
if (!item.urls) {
|
|
11530
|
+
SpineAtlasLoader._assignAssetPathsFromUrl(item.url, spineAtlasAsset, resourceManager);
|
|
11531
|
+
} else {
|
|
11532
|
+
var urls = item.urls;
|
|
11533
|
+
for(var i = 0, len = urls.length; i < len; i += 1){
|
|
11534
|
+
var url = urls[i];
|
|
11535
|
+
SpineAtlasLoader._groupAssetsByExtension(url, spineAtlasAsset, resourceManager);
|
|
11536
|
+
}
|
|
11537
|
+
}
|
|
11538
|
+
var atlasPath = spineAtlasAsset.atlasPath;
|
|
11539
|
+
if (!atlasPath) {
|
|
11540
|
+
reject(new Error("Failed to load spine atlas. Please check the file path and ensure the file extension is included."));
|
|
11541
|
+
return;
|
|
11542
|
+
}
|
|
11543
|
+
var imagePaths = spineAtlasAsset.imagePaths;
|
|
11544
|
+
if (imagePaths.length === 0) {
|
|
11545
|
+
var atlasPath1 = item.url;
|
|
11546
|
+
LoaderUtils.loadTextureAtlas(atlasPath1, engine, reject).then(function(textureAtlas) {
|
|
11547
|
+
resolve(textureAtlas);
|
|
11548
|
+
}).catch(function(err) {
|
|
11549
|
+
reject(err);
|
|
11550
|
+
});
|
|
11551
|
+
} else {
|
|
11552
|
+
var atlasPath2 = spineAtlasAsset.atlasPath, imagePaths1 = spineAtlasAsset.imagePaths, imageExtensions = spineAtlasAsset.imageExtensions;
|
|
11553
|
+
if (imagePaths1.length > 0) {
|
|
11554
|
+
Promise.all([
|
|
12027
11555
|
// @ts-ignore
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
11556
|
+
resourceManager._request(atlasPath2, {
|
|
11557
|
+
type: "text"
|
|
11558
|
+
}),
|
|
11559
|
+
LoaderUtils.loadTexturesByPaths(imagePaths1, imageExtensions, engine, reject)
|
|
11560
|
+
]).then(function(param) {
|
|
11561
|
+
var atlasText = param[0], textures = param[1];
|
|
11562
|
+
var textureAtlas = LoaderUtils.createTextureAtlas(atlasText, textures);
|
|
11563
|
+
resolve(textureAtlas);
|
|
11564
|
+
}).catch(function(err) {
|
|
11565
|
+
reject(err);
|
|
11566
|
+
});
|
|
11567
|
+
} else {
|
|
11568
|
+
LoaderUtils.loadTextureAtlas(atlasPath2, engine, reject).then(function(textureAtlas) {
|
|
12040
11569
|
resolve(textureAtlas);
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
11570
|
+
}).catch(function(err) {
|
|
11571
|
+
reject(err);
|
|
11572
|
+
});
|
|
12044
11573
|
}
|
|
12045
|
-
}
|
|
12046
|
-
})
|
|
11574
|
+
}
|
|
11575
|
+
});
|
|
11576
|
+
};
|
|
11577
|
+
SpineAtlasLoader._groupAssetsByExtension = function _groupAssetsByExtension(url, assetPath, resourceManager) {
|
|
11578
|
+
var ext = SpineLoader._getUrlExtension(url);
|
|
11579
|
+
if (!ext) return;
|
|
11580
|
+
if (ext === "atlas") {
|
|
11581
|
+
assetPath.atlasPath = url;
|
|
11582
|
+
}
|
|
11583
|
+
if ([
|
|
11584
|
+
"png",
|
|
11585
|
+
"jpg",
|
|
11586
|
+
"webp",
|
|
11587
|
+
"jpeg",
|
|
11588
|
+
"ktx",
|
|
11589
|
+
"ktx2"
|
|
11590
|
+
].includes(ext)) {
|
|
11591
|
+
assetPath.imagePaths.push(url);
|
|
11592
|
+
}
|
|
11593
|
+
};
|
|
11594
|
+
SpineAtlasLoader._assignAssetPathsFromUrl = function _assignAssetPathsFromUrl(url, assetPath, resourceManager) {
|
|
11595
|
+
var ext = SpineLoader._getUrlExtension(url);
|
|
11596
|
+
if (ext === "atlas") {
|
|
11597
|
+
var _resourceManager__virtualPathResourceMap_url, _resourceManager__virtualPathResourceMap;
|
|
11598
|
+
assetPath.atlasPath = url;
|
|
11599
|
+
// @ts-ignore
|
|
11600
|
+
var atlasDependency = resourceManager == null ? void 0 : (_resourceManager__virtualPathResourceMap = resourceManager._virtualPathResourceMap) == null ? void 0 : (_resourceManager__virtualPathResourceMap_url = _resourceManager__virtualPathResourceMap[url]) == null ? void 0 : _resourceManager__virtualPathResourceMap_url.dependentAssetMap;
|
|
11601
|
+
if (atlasDependency) {
|
|
11602
|
+
for(var key in atlasDependency){
|
|
11603
|
+
var imageVirtualPath = atlasDependency[key];
|
|
11604
|
+
assetPath.imagePaths.push(imageVirtualPath);
|
|
11605
|
+
}
|
|
11606
|
+
}
|
|
11607
|
+
}
|
|
12047
11608
|
};
|
|
12048
|
-
return
|
|
11609
|
+
return SpineAtlasLoader;
|
|
12049
11610
|
}(engine.Loader);
|
|
12050
|
-
|
|
12051
|
-
engine.resourceLoader("
|
|
11611
|
+
SpineAtlasLoader = __decorate([
|
|
11612
|
+
engine.resourceLoader("SpineAtlas", [
|
|
12052
11613
|
"atlas"
|
|
12053
11614
|
])
|
|
12054
|
-
],
|
|
11615
|
+
], SpineAtlasLoader);
|
|
11616
|
+
|
|
11617
|
+
var LoaderObject = /*#__PURE__*/Object.freeze({
|
|
11618
|
+
__proto__: null,
|
|
11619
|
+
SpineResource: SpineResource,
|
|
11620
|
+
LoaderUtils: LoaderUtils
|
|
11621
|
+
});
|
|
12055
11622
|
|
|
12056
|
-
var
|
|
12057
|
-
|
|
11623
|
+
var RendererObject = /*#__PURE__*/Object.freeze({
|
|
11624
|
+
__proto__: null,
|
|
11625
|
+
SpineAnimationRenderer: SpineAnimationRenderer,
|
|
11626
|
+
SpineMaterial: SpineMaterial
|
|
11627
|
+
});
|
|
11628
|
+
|
|
11629
|
+
for(var key in RendererObject){
|
|
11630
|
+
engine.Loader.registerClass(key, RendererObject[key]);
|
|
11631
|
+
}
|
|
11632
|
+
for(var key1 in LoaderObject){
|
|
11633
|
+
engine.Loader.registerClass(key1, LoaderObject[key1]);
|
|
11634
|
+
}
|
|
11635
|
+
var version = "4.2.1";
|
|
12058
11636
|
console.log("Galacean spine version: " + version);
|
|
12059
11637
|
|
|
12060
11638
|
exports.AlphaTimeline = AlphaTimeline;
|
|
@@ -12096,6 +11674,7 @@ exports.IkConstraintTimeline = IkConstraintTimeline;
|
|
|
12096
11674
|
exports.InheritTimeline = InheritTimeline;
|
|
12097
11675
|
exports.IntSet = IntSet;
|
|
12098
11676
|
exports.Interpolation = Interpolation;
|
|
11677
|
+
exports.LoaderUtils = LoaderUtils;
|
|
12099
11678
|
exports.MathUtils = MathUtils;
|
|
12100
11679
|
exports.MeshAttachment = MeshAttachment;
|
|
12101
11680
|
exports.PathAttachment = PathAttachment;
|
|
@@ -12137,13 +11716,14 @@ exports.SkeletonBinary = SkeletonBinary;
|
|
|
12137
11716
|
exports.SkeletonBounds = SkeletonBounds;
|
|
12138
11717
|
exports.SkeletonClipping = SkeletonClipping;
|
|
12139
11718
|
exports.SkeletonData = SkeletonData;
|
|
12140
|
-
exports.SkeletonDataResource = SkeletonDataResource;
|
|
12141
11719
|
exports.SkeletonJson = SkeletonJson;
|
|
12142
11720
|
exports.Skin = Skin;
|
|
12143
11721
|
exports.SkinEntry = SkinEntry;
|
|
12144
11722
|
exports.Slot = Slot;
|
|
12145
11723
|
exports.SlotData = SlotData;
|
|
12146
11724
|
exports.SpineAnimationRenderer = SpineAnimationRenderer;
|
|
11725
|
+
exports.SpineMaterial = SpineMaterial;
|
|
11726
|
+
exports.SpineResource = SpineResource;
|
|
12147
11727
|
exports.StringSet = StringSet;
|
|
12148
11728
|
exports.Texture = Texture;
|
|
12149
11729
|
exports.TextureAtlas = TextureAtlas;
|
|
@@ -12164,6 +11744,5 @@ exports.Utils = Utils;
|
|
|
12164
11744
|
exports.Vector2 = Vector2;
|
|
12165
11745
|
exports.VertexAttachment = VertexAttachment;
|
|
12166
11746
|
exports.WindowedMean = WindowedMean;
|
|
12167
|
-
exports.createTextureAtlas = createTextureAtlas;
|
|
12168
11747
|
exports.version = version;
|
|
12169
11748
|
//# sourceMappingURL=main.js.map
|