@galacean/engine-spine 4.2.6 → 4.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -1
- package/dist/main.js +148 -574
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +148 -574
- package/dist/module.js +149 -574
- package/dist/module.js.map +1 -1
- package/package.json +2 -2
- package/types/AntGSpineLoader.d.ts +0 -22
- package/types/SpineAnimation.d.ts +0 -45
- package/types/SpineLoader.d.ts +0 -32
- package/types/SpineMaterial.d.ts +0 -6
- package/types/SpineRenderer.d.ts +0 -38
- package/types/core/MeshGenerator.d.ts +0 -43
- package/types/core/SpineMesh.d.ts +0 -11
- package/types/spine-core/Animation.d.ts +0 -378
- package/types/spine-core/AnimationState.d.ts +0 -365
- package/types/spine-core/AnimationStateData.d.ts +0 -23
- package/types/spine-core/AssetManager.d.ts +0 -36
- package/types/spine-core/AtlasAttachmentLoader.d.ts +0 -23
- package/types/spine-core/BlendMode.d.ts +0 -7
- package/types/spine-core/Bone.d.ts +0 -110
- package/types/spine-core/BoneData.d.ts +0 -44
- package/types/spine-core/ConstraintData.d.ts +0 -7
- package/types/spine-core/Event.d.ts +0 -16
- package/types/spine-core/EventData.d.ts +0 -13
- package/types/spine-core/IkConstraint.d.ts +0 -38
- package/types/spine-core/IkConstraintData.d.ts +0 -26
- package/types/spine-core/PathConstraint.d.ts +0 -46
- package/types/spine-core/PathConstraintData.d.ts +0 -52
- package/types/spine-core/SharedAssetManager.d.ts +0 -19
- package/types/spine-core/Skeleton.d.ts +0 -134
- package/types/spine-core/SkeletonBinary.d.ts +0 -49
- package/types/spine-core/SkeletonBounds.d.ts +0 -48
- package/types/spine-core/SkeletonClipping.d.ts +0 -22
- package/types/spine-core/SkeletonData.d.ts +0 -89
- package/types/spine-core/SkeletonJson.d.ts +0 -34
- package/types/spine-core/Skin.d.ts +0 -43
- package/types/spine-core/Slot.d.ts +0 -42
- package/types/spine-core/SlotData.d.ts +0 -23
- package/types/spine-core/Texture.d.ts +0 -46
- package/types/spine-core/TextureAtlas.d.ts +0 -30
- package/types/spine-core/TransformConstraint.d.ts +0 -36
- package/types/spine-core/TransformConstraintData.d.ts +0 -34
- package/types/spine-core/Triangulator.d.ts +0 -14
- package/types/spine-core/Updatable.d.ts +0 -9
- package/types/spine-core/Utils.d.ts +0 -124
- package/types/spine-core/VertexEffect.d.ts +0 -7
- package/types/spine-core/attachments/Attachment.d.ts +0 -43
- package/types/spine-core/attachments/AttachmentLoader.d.ts +0 -25
- package/types/spine-core/attachments/AttachmentType.d.ts +0 -9
- package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +0 -12
- package/types/spine-core/attachments/ClippingAttachment.d.ts +0 -14
- package/types/spine-core/attachments/MeshAttachment.d.ts +0 -46
- package/types/spine-core/attachments/PathAttachment.d.ts +0 -19
- package/types/spine-core/attachments/PointAttachment.d.ts +0 -20
- package/types/spine-core/attachments/RegionAttachment.d.ts +0 -88
- package/types/spine-core/polyfills.d.ts +0 -3
- package/types/spine-core/vertexeffects/JitterEffect.d.ts +0 -11
- package/types/spine-core/vertexeffects/SwirlEffect.d.ts +0 -16
- package/types/types.d.ts +0 -4
package/dist/main.js
CHANGED
|
@@ -32,103 +32,17 @@ function _instanceof1(left, right) {
|
|
|
32
32
|
} else return _instanceof1(left, right);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function _type_of(obj) {
|
|
36
|
+
"@swc/helpers - typeof";
|
|
37
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
function __decorate(decorators, target, key, desc) {
|
|
36
41
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
37
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
42
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
38
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;
|
|
39
44
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
40
45
|
}
|
|
41
|
-
function __generator(thisArg, body) {
|
|
42
|
-
var _ = {
|
|
43
|
-
label: 0,
|
|
44
|
-
sent: function sent() {
|
|
45
|
-
if (t[0] & 1) throw t[1];
|
|
46
|
-
return t[1];
|
|
47
|
-
},
|
|
48
|
-
trys: [],
|
|
49
|
-
ops: []
|
|
50
|
-
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
51
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
52
|
-
return this;
|
|
53
|
-
}), g;
|
|
54
|
-
function verb(n) {
|
|
55
|
-
return function(v) {
|
|
56
|
-
return step([
|
|
57
|
-
n,
|
|
58
|
-
v
|
|
59
|
-
]);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function step(op) {
|
|
63
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
64
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
65
|
-
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;
|
|
66
|
-
if (y = 0, t) op = [
|
|
67
|
-
op[0] & 2,
|
|
68
|
-
t.value
|
|
69
|
-
];
|
|
70
|
-
switch(op[0]){
|
|
71
|
-
case 0:
|
|
72
|
-
case 1:
|
|
73
|
-
t = op;
|
|
74
|
-
break;
|
|
75
|
-
case 4:
|
|
76
|
-
_.label++;
|
|
77
|
-
return {
|
|
78
|
-
value: op[1],
|
|
79
|
-
done: false
|
|
80
|
-
};
|
|
81
|
-
case 5:
|
|
82
|
-
_.label++;
|
|
83
|
-
y = op[1];
|
|
84
|
-
op = [
|
|
85
|
-
0
|
|
86
|
-
];
|
|
87
|
-
continue;
|
|
88
|
-
case 7:
|
|
89
|
-
op = _.ops.pop();
|
|
90
|
-
_.trys.pop();
|
|
91
|
-
continue;
|
|
92
|
-
default:
|
|
93
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
94
|
-
_ = 0;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
98
|
-
_.label = op[1];
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
102
|
-
_.label = t[1];
|
|
103
|
-
t = op;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
if (t && _.label < t[2]) {
|
|
107
|
-
_.label = t[2];
|
|
108
|
-
_.ops.push(op);
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
if (t[2]) _.ops.pop();
|
|
112
|
-
_.trys.pop();
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
op = body.call(thisArg, _);
|
|
116
|
-
} catch (e) {
|
|
117
|
-
op = [
|
|
118
|
-
6,
|
|
119
|
-
e
|
|
120
|
-
];
|
|
121
|
-
y = 0;
|
|
122
|
-
} finally{
|
|
123
|
-
f = t = 0;
|
|
124
|
-
}
|
|
125
|
-
if (op[0] & 5) throw op[1];
|
|
126
|
-
return {
|
|
127
|
-
value: op[0] ? op[1] : void 0,
|
|
128
|
-
done: true
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
46
|
typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
|
|
133
47
|
var e = new Error(message);
|
|
134
48
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -169,34 +83,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
169
83
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
170
84
|
}
|
|
171
85
|
|
|
172
|
-
|
|
173
|
-
* Spine Runtimes License Agreement
|
|
174
|
-
* Last updated April 5, 2025. Replaces all prior versions.
|
|
175
|
-
*
|
|
176
|
-
* Copyright (c) 2013-2025, Esoteric Software LLC
|
|
177
|
-
*
|
|
178
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
179
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
180
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
181
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
182
|
-
*
|
|
183
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
184
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
185
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
186
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
187
|
-
* include this license and copyright notice.
|
|
188
|
-
*
|
|
189
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
190
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
191
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
192
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
193
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
194
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
195
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
196
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
197
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
198
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
199
|
-
*****************************************************************************/ var IntSet = /*#__PURE__*/ function() {
|
|
86
|
+
var IntSet = /*#__PURE__*/ function() {
|
|
200
87
|
function IntSet() {
|
|
201
88
|
this.array = new Array();
|
|
202
89
|
}
|
|
@@ -315,9 +202,8 @@ var Color = /*#__PURE__*/ function() {
|
|
|
315
202
|
color.g = ((value & 0x0000ff00) >>> 8) / 255;
|
|
316
203
|
color.b = (value & 0x000000ff) / 255;
|
|
317
204
|
};
|
|
318
|
-
Color.fromString = function fromString(hex
|
|
319
|
-
|
|
320
|
-
return color.setFromString(hex);
|
|
205
|
+
Color.fromString = function fromString(hex) {
|
|
206
|
+
return new Color().setFromString(hex);
|
|
321
207
|
};
|
|
322
208
|
return Color;
|
|
323
209
|
}();
|
|
@@ -2941,16 +2827,18 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
2941
2827
|
var finished = this.updateMixingFrom(from, delta);
|
|
2942
2828
|
from.animationLast = from.nextAnimationLast;
|
|
2943
2829
|
from.trackLast = from.nextTrackLast;
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
to.
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2830
|
+
if (to.nextTrackLast != -1) {
|
|
2831
|
+
var discard = to.mixTime == 0 && from.mixTime == 0; // Discard the from entry when neither have advanced yet.
|
|
2832
|
+
if (to.mixTime >= to.mixDuration || discard) {
|
|
2833
|
+
// Require totalAlpha == 0 to ensure mixing is complete or the transition is a single frame or discarded.
|
|
2834
|
+
if (from.totalAlpha == 0 || to.mixDuration == 0 || discard) {
|
|
2835
|
+
to.mixingFrom = from.mixingFrom;
|
|
2836
|
+
if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
|
|
2837
|
+
to.interruptAlpha = from.interruptAlpha;
|
|
2838
|
+
this.queue.end(from);
|
|
2839
|
+
}
|
|
2840
|
+
return finished;
|
|
2952
2841
|
}
|
|
2953
|
-
return finished;
|
|
2954
2842
|
}
|
|
2955
2843
|
from.trackTime += delta * from.timeScale;
|
|
2956
2844
|
to.mixTime += delta;
|
|
@@ -3315,11 +3203,10 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
3315
3203
|
if (!last) {
|
|
3316
3204
|
this.setCurrent(trackIndex, entry, true);
|
|
3317
3205
|
this.queue.drain();
|
|
3318
|
-
if (delay < 0) delay = 0;
|
|
3319
3206
|
} else {
|
|
3320
3207
|
last.next = entry;
|
|
3321
3208
|
entry.previous = last;
|
|
3322
|
-
if (delay <= 0) delay
|
|
3209
|
+
if (delay <= 0) delay += last.getTrackComplete() - entry.mixDuration;
|
|
3323
3210
|
}
|
|
3324
3211
|
entry.delay = delay;
|
|
3325
3212
|
return entry;
|
|
@@ -3358,7 +3245,7 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
3358
3245
|
if (mixDuration === void 0) mixDuration = 0;
|
|
3359
3246
|
if (delay === void 0) delay = 0;
|
|
3360
3247
|
var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);
|
|
3361
|
-
if (delay <= 0) entry.delay
|
|
3248
|
+
if (delay <= 0) entry.delay += entry.mixDuration - mixDuration;
|
|
3362
3249
|
entry.mixDuration = mixDuration;
|
|
3363
3250
|
entry.trackEnd = mixDuration;
|
|
3364
3251
|
return entry;
|
|
@@ -3612,10 +3499,7 @@ AnimationState._emptyAnimation = new Animation("<empty>", [], 0);
|
|
|
3612
3499
|
var _proto = TrackEntry.prototype;
|
|
3613
3500
|
_proto.setMixDurationWithDelay = function setMixDurationWithDelay(mixDuration, delay) {
|
|
3614
3501
|
this._mixDuration = mixDuration;
|
|
3615
|
-
if (delay <= 0)
|
|
3616
|
-
if (this.previous != null) delay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0);
|
|
3617
|
-
else delay = 0;
|
|
3618
|
-
}
|
|
3502
|
+
if (this.previous != null && delay <= 0) delay += this.previous.getTrackComplete() - mixDuration;
|
|
3619
3503
|
this.delay = delay;
|
|
3620
3504
|
};
|
|
3621
3505
|
_proto.reset = function reset() {
|
|
@@ -3838,17 +3722,17 @@ var CURRENT = 2;
|
|
|
3838
3722
|
|
|
3839
3723
|
/******************************************************************************
|
|
3840
3724
|
* Spine Runtimes License Agreement
|
|
3841
|
-
* Last updated
|
|
3725
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
3842
3726
|
*
|
|
3843
|
-
* Copyright (c) 2013-
|
|
3727
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
3844
3728
|
*
|
|
3845
3729
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
3846
3730
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
3847
3731
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
3848
3732
|
* http://esotericsoftware.com/spine-editor-license
|
|
3849
3733
|
*
|
|
3850
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
3851
|
-
*
|
|
3734
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
3735
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
3852
3736
|
* "Products"), provided that each user of the Products must obtain their own
|
|
3853
3737
|
* Spine Editor license and redistribution of the Products in any form must
|
|
3854
3738
|
* include this license and copyright notice.
|
|
@@ -3861,8 +3745,8 @@ var CURRENT = 2;
|
|
|
3861
3745
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
3862
3746
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
3863
3747
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
3864
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
3865
|
-
*
|
|
3748
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
3749
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
3866
3750
|
*****************************************************************************/ /** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */ var AnimationStateData = /*#__PURE__*/ function() {
|
|
3867
3751
|
function AnimationStateData(skeletonData) {
|
|
3868
3752
|
this.animationToMixTime = {};
|
|
@@ -3943,34 +3827,7 @@ var CURRENT = 2;
|
|
|
3943
3827
|
}
|
|
3944
3828
|
(VertexAttachment);
|
|
3945
3829
|
|
|
3946
|
-
|
|
3947
|
-
* Spine Runtimes License Agreement
|
|
3948
|
-
* Last updated April 5, 2025. Replaces all prior versions.
|
|
3949
|
-
*
|
|
3950
|
-
* Copyright (c) 2013-2025, Esoteric Software LLC
|
|
3951
|
-
*
|
|
3952
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
3953
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
3954
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
3955
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
3956
|
-
*
|
|
3957
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
3958
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
3959
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
3960
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
3961
|
-
* include this license and copyright notice.
|
|
3962
|
-
*
|
|
3963
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
3964
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
3965
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
3966
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
3967
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
3968
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
3969
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
3970
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
3971
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
3972
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
3973
|
-
*****************************************************************************/ var Texture = /*#__PURE__*/ function() {
|
|
3830
|
+
var Texture = /*#__PURE__*/ function() {
|
|
3974
3831
|
function Texture(image) {
|
|
3975
3832
|
this._image = image;
|
|
3976
3833
|
}
|
|
@@ -4341,7 +4198,7 @@ var TextureAtlasRegion = /*#__PURE__*/ function(TextureRegion) {
|
|
|
4341
4198
|
this.copyTo(copy);
|
|
4342
4199
|
copy.regionUVs = new Array(this.regionUVs.length);
|
|
4343
4200
|
Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);
|
|
4344
|
-
copy.uvs =
|
|
4201
|
+
copy.uvs = new Array(this.uvs.length);
|
|
4345
4202
|
Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);
|
|
4346
4203
|
copy.triangles = new Array(this.triangles.length);
|
|
4347
4204
|
Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);
|
|
@@ -5005,17 +4862,17 @@ RegionAttachment.V4 = 31;
|
|
|
5005
4862
|
|
|
5006
4863
|
/******************************************************************************
|
|
5007
4864
|
* Spine Runtimes License Agreement
|
|
5008
|
-
* Last updated
|
|
4865
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
5009
4866
|
*
|
|
5010
|
-
* Copyright (c) 2013-
|
|
4867
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
5011
4868
|
*
|
|
5012
4869
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
5013
4870
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
5014
4871
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
5015
4872
|
* http://esotericsoftware.com/spine-editor-license
|
|
5016
4873
|
*
|
|
5017
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
5018
|
-
*
|
|
4874
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
4875
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
5019
4876
|
* "Products"), provided that each user of the Products must obtain their own
|
|
5020
4877
|
* Spine Editor license and redistribution of the Products in any form must
|
|
5021
4878
|
* include this license and copyright notice.
|
|
@@ -5028,8 +4885,8 @@ RegionAttachment.V4 = 31;
|
|
|
5028
4885
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
5029
4886
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
5030
4887
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
5031
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
5032
|
-
*
|
|
4888
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
4889
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
5033
4890
|
*****************************************************************************/ /** The base class for all constraint datas. */ var ConstraintData = function ConstraintData(name, order, skinRequired) {
|
|
5034
4891
|
this.name = name;
|
|
5035
4892
|
this.order = order;
|
|
@@ -5037,46 +4894,18 @@ RegionAttachment.V4 = 31;
|
|
|
5037
4894
|
}
|
|
5038
4895
|
;
|
|
5039
4896
|
|
|
5040
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5041
|
-
try {
|
|
5042
|
-
var info = gen[key](arg);
|
|
5043
|
-
var value = info.value;
|
|
5044
|
-
} catch (error) {
|
|
5045
|
-
reject(error);
|
|
5046
|
-
return;
|
|
5047
|
-
}
|
|
5048
|
-
if (info.done) resolve(value);
|
|
5049
|
-
else Promise.resolve(value).then(_next, _throw);
|
|
5050
|
-
}
|
|
5051
|
-
function _async_to_generator(fn) {
|
|
5052
|
-
return function() {
|
|
5053
|
-
var self = this, args = arguments;
|
|
5054
|
-
return new Promise(function(resolve, reject) {
|
|
5055
|
-
var gen = fn.apply(self, args);
|
|
5056
|
-
function _next(value) {
|
|
5057
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
5058
|
-
}
|
|
5059
|
-
function _throw(err) {
|
|
5060
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
5061
|
-
}
|
|
5062
|
-
_next(undefined);
|
|
5063
|
-
});
|
|
5064
|
-
};
|
|
5065
|
-
}
|
|
5066
|
-
|
|
5067
4897
|
var AssetManagerBase = /*#__PURE__*/ function() {
|
|
5068
|
-
function AssetManagerBase(textureLoader, pathPrefix, downloader
|
|
4898
|
+
function AssetManagerBase(textureLoader, pathPrefix, downloader) {
|
|
5069
4899
|
if (pathPrefix === void 0) pathPrefix = "";
|
|
5070
4900
|
if (downloader === void 0) downloader = new Downloader();
|
|
5071
|
-
if (cache === void 0) cache = new AssetCache();
|
|
5072
4901
|
this.pathPrefix = "";
|
|
4902
|
+
this.assets = {};
|
|
5073
4903
|
this.errors = {};
|
|
5074
4904
|
this.toLoad = 0;
|
|
5075
4905
|
this.loaded = 0;
|
|
5076
4906
|
this.textureLoader = textureLoader;
|
|
5077
4907
|
this.pathPrefix = pathPrefix;
|
|
5078
4908
|
this.downloader = downloader;
|
|
5079
|
-
this.cache = cache;
|
|
5080
4909
|
}
|
|
5081
4910
|
var _proto = AssetManagerBase.prototype;
|
|
5082
4911
|
_proto.start = function start(path) {
|
|
@@ -5086,8 +4915,7 @@ var AssetManagerBase = /*#__PURE__*/ function() {
|
|
|
5086
4915
|
_proto.success = function success(callback, path, asset) {
|
|
5087
4916
|
this.toLoad--;
|
|
5088
4917
|
this.loaded++;
|
|
5089
|
-
this.
|
|
5090
|
-
this.cache.assetsRefCount[path] = (this.cache.assetsRefCount[path] || 0) + 1;
|
|
4918
|
+
this.assets[path] = asset;
|
|
5091
4919
|
if (callback) callback(path, asset);
|
|
5092
4920
|
};
|
|
5093
4921
|
_proto.error = function error(callback, path, message) {
|
|
@@ -5119,16 +4947,10 @@ var AssetManagerBase = /*#__PURE__*/ function() {
|
|
|
5119
4947
|
if (success === void 0) success = function() {};
|
|
5120
4948
|
if (error === void 0) error = function() {};
|
|
5121
4949
|
path = this.start(path);
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
resolve(data);
|
|
5127
|
-
}, function(status, responseText) {
|
|
5128
|
-
var errorMsg = "Couldn't load binary " + path + ": status " + status + ", " + responseText;
|
|
5129
|
-
_this.error(error, path, errorMsg);
|
|
5130
|
-
reject(errorMsg);
|
|
5131
|
-
});
|
|
4950
|
+
this.downloader.downloadBinary(path, function(data) {
|
|
4951
|
+
_this.success(success, path, data);
|
|
4952
|
+
}, function(status, responseText) {
|
|
4953
|
+
_this.error(error, path, "Couldn't load binary " + path + ": status " + status + ", " + responseText);
|
|
5132
4954
|
});
|
|
5133
4955
|
};
|
|
5134
4956
|
_proto.loadText = function loadText(path, success, error) {
|
|
@@ -5147,83 +4969,46 @@ var AssetManagerBase = /*#__PURE__*/ function() {
|
|
|
5147
4969
|
if (success === void 0) success = function() {};
|
|
5148
4970
|
if (error === void 0) error = function() {};
|
|
5149
4971
|
path = this.start(path);
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
resolve(data);
|
|
5155
|
-
}, function(status, responseText) {
|
|
5156
|
-
var errorMsg = "Couldn't load JSON " + path + ": status " + status + ", " + responseText;
|
|
5157
|
-
_this.error(error, path, errorMsg);
|
|
5158
|
-
reject(errorMsg);
|
|
5159
|
-
});
|
|
4972
|
+
this.downloader.downloadJson(path, function(data) {
|
|
4973
|
+
_this.success(success, path, data);
|
|
4974
|
+
}, function(status, responseText) {
|
|
4975
|
+
_this.error(error, path, "Couldn't load JSON " + path + ": status " + status + ", " + responseText);
|
|
5160
4976
|
});
|
|
5161
4977
|
};
|
|
5162
|
-
_proto.reuseAssets = function reuseAssets(path, success, error) {
|
|
5163
|
-
var _this = this;
|
|
5164
|
-
if (success === void 0) success = function() {};
|
|
5165
|
-
if (error === void 0) error = function() {};
|
|
5166
|
-
var loadedStatus = this.cache.assetsLoaded[path];
|
|
5167
|
-
var alreadyExistsOrLoading = loadedStatus !== undefined;
|
|
5168
|
-
if (alreadyExistsOrLoading) {
|
|
5169
|
-
this.cache.assetsLoaded[path] = loadedStatus.then(function(data) {
|
|
5170
|
-
// necessary when user preloads an image into the cache.
|
|
5171
|
-
// texture loader is not avaiable in the cache, so we transform in GLTexture at first use
|
|
5172
|
-
data = _instanceof1(data, Image) || _instanceof1(data, ImageBitmap) ? _this.textureLoader(data) : data;
|
|
5173
|
-
_this.success(success, path, data);
|
|
5174
|
-
return data;
|
|
5175
|
-
}).catch(function(errorMsg) {
|
|
5176
|
-
return _this.error(error, path, errorMsg);
|
|
5177
|
-
});
|
|
5178
|
-
}
|
|
5179
|
-
return alreadyExistsOrLoading;
|
|
5180
|
-
};
|
|
5181
4978
|
_proto.loadTexture = function loadTexture(path, success, error) {
|
|
5182
4979
|
var _this = this;
|
|
5183
4980
|
if (success === void 0) success = function() {};
|
|
5184
4981
|
if (error === void 0) error = function() {};
|
|
5185
4982
|
path = this.start(path);
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
_this.success(success, path, texture);
|
|
5216
|
-
resolve(texture);
|
|
5217
|
-
};
|
|
5218
|
-
image.onerror = function() {
|
|
5219
|
-
var errorMsg = "Couldn't load image: " + path;
|
|
5220
|
-
_this.error(error, path, errorMsg);
|
|
5221
|
-
reject(errorMsg);
|
|
5222
|
-
};
|
|
5223
|
-
if (_this.downloader.rawDataUris[path]) path = _this.downloader.rawDataUris[path];
|
|
5224
|
-
image.src = path;
|
|
5225
|
-
}
|
|
5226
|
-
});
|
|
4983
|
+
var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);
|
|
4984
|
+
var isWebWorker = !isBrowser; // && typeof importScripts !== 'undefined';
|
|
4985
|
+
if (isWebWorker) {
|
|
4986
|
+
fetch(path, {
|
|
4987
|
+
mode: "cors"
|
|
4988
|
+
}).then(function(response) {
|
|
4989
|
+
if (response.ok) return response.blob();
|
|
4990
|
+
_this.error(error, path, "Couldn't load image: " + path);
|
|
4991
|
+
return null;
|
|
4992
|
+
}).then(function(blob) {
|
|
4993
|
+
return blob ? createImageBitmap(blob, {
|
|
4994
|
+
premultiplyAlpha: "none",
|
|
4995
|
+
colorSpaceConversion: "none"
|
|
4996
|
+
}) : null;
|
|
4997
|
+
}).then(function(bitmap) {
|
|
4998
|
+
if (bitmap) _this.success(success, path, _this.textureLoader(bitmap));
|
|
4999
|
+
});
|
|
5000
|
+
} else {
|
|
5001
|
+
var image = new Image();
|
|
5002
|
+
image.crossOrigin = "anonymous";
|
|
5003
|
+
image.onload = function() {
|
|
5004
|
+
_this.success(success, path, _this.textureLoader(image));
|
|
5005
|
+
};
|
|
5006
|
+
image.onerror = function() {
|
|
5007
|
+
_this.error(error, path, "Couldn't load image: " + path);
|
|
5008
|
+
};
|
|
5009
|
+
if (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path];
|
|
5010
|
+
image.src = path;
|
|
5011
|
+
}
|
|
5227
5012
|
};
|
|
5228
5013
|
_proto.loadTextureAtlas = function loadTextureAtlas(path, success, error, fileAlias) {
|
|
5229
5014
|
var _this = this;
|
|
@@ -5232,189 +5017,53 @@ var AssetManagerBase = /*#__PURE__*/ function() {
|
|
|
5232
5017
|
var index = path.lastIndexOf("/");
|
|
5233
5018
|
var parent = index >= 0 ? path.substring(0, index + 1) : "";
|
|
5234
5019
|
path = this.start(path);
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
if (
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
};
|
|
5258
|
-
var atlas = _this.createTextureAtlas(path, atlasText);
|
|
5259
|
-
var toLoad = atlas.pages.length, abort = false;
|
|
5260
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;)_loop();
|
|
5261
|
-
} catch (e) {
|
|
5262
|
-
var errorMsg = "Couldn't parse texture atlas " + path + ": " + e.message;
|
|
5263
|
-
_this.error(error, path, errorMsg);
|
|
5264
|
-
reject(errorMsg);
|
|
5265
|
-
}
|
|
5266
|
-
}, function(status, responseText) {
|
|
5267
|
-
var errorMsg = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText;
|
|
5268
|
-
_this.error(error, path, errorMsg);
|
|
5269
|
-
reject(errorMsg);
|
|
5270
|
-
});
|
|
5271
|
-
});
|
|
5272
|
-
};
|
|
5273
|
-
_proto.loadTextureAtlasButNoTextures = function loadTextureAtlasButNoTextures(path, success, error, fileAlias) {
|
|
5274
|
-
var _this = this;
|
|
5275
|
-
if (success === void 0) success = function() {};
|
|
5276
|
-
if (error === void 0) error = function() {};
|
|
5277
|
-
path = this.start(path);
|
|
5278
|
-
if (this.reuseAssets(path, success, error)) return;
|
|
5279
|
-
this.cache.assetsLoaded[path] = new Promise(function(resolve, reject) {
|
|
5280
|
-
_this.downloader.downloadText(path, function(atlasText) {
|
|
5281
|
-
try {
|
|
5282
|
-
var atlas = _this.createTextureAtlas(path, atlasText);
|
|
5283
|
-
_this.success(success, path, atlas);
|
|
5284
|
-
resolve(atlas);
|
|
5285
|
-
} catch (e) {
|
|
5286
|
-
var errorMsg = "Couldn't parse texture atlas " + path + ": " + e.message;
|
|
5287
|
-
_this.error(error, path, errorMsg);
|
|
5288
|
-
reject(errorMsg);
|
|
5289
|
-
}
|
|
5290
|
-
}, function(status, responseText) {
|
|
5291
|
-
var errorMsg = "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText;
|
|
5292
|
-
_this.error(error, path, errorMsg);
|
|
5293
|
-
reject(errorMsg);
|
|
5294
|
-
});
|
|
5020
|
+
this.downloader.downloadText(path, function(atlasText) {
|
|
5021
|
+
try {
|
|
5022
|
+
var _loop = function() {
|
|
5023
|
+
var page = _step.value;
|
|
5024
|
+
_this.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name], function(imagePath, texture) {
|
|
5025
|
+
if (!abort) {
|
|
5026
|
+
page.setTexture(texture);
|
|
5027
|
+
if (--toLoad == 0) _this.success(success, path, atlas);
|
|
5028
|
+
}
|
|
5029
|
+
}, function(imagePath, message) {
|
|
5030
|
+
if (!abort) _this.error(error, path, "Couldn't load texture atlas " + path + " page image: " + imagePath);
|
|
5031
|
+
abort = true;
|
|
5032
|
+
});
|
|
5033
|
+
};
|
|
5034
|
+
var atlas = new TextureAtlas(atlasText);
|
|
5035
|
+
var toLoad = atlas.pages.length, abort = false;
|
|
5036
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;)_loop();
|
|
5037
|
+
} catch (e) {
|
|
5038
|
+
_this.error(error, path, "Couldn't parse texture atlas " + path + ": " + e.message);
|
|
5039
|
+
}
|
|
5040
|
+
}, function(status, responseText) {
|
|
5041
|
+
_this.error(error, path, "Couldn't load texture atlas " + path + ": status " + status + ", " + responseText);
|
|
5295
5042
|
});
|
|
5296
5043
|
};
|
|
5297
|
-
// Promisified versions of load function
|
|
5298
|
-
_proto.loadBinaryAsync = function loadBinaryAsync(path) {
|
|
5299
|
-
return _async_to_generator(function() {
|
|
5300
|
-
var _this;
|
|
5301
|
-
return __generator(this, function(_state) {
|
|
5302
|
-
_this = this;
|
|
5303
|
-
return [
|
|
5304
|
-
2,
|
|
5305
|
-
new Promise(function(resolve, reject) {
|
|
5306
|
-
_this.loadBinary(path, function(_, binary) {
|
|
5307
|
-
return resolve(binary);
|
|
5308
|
-
}, function(_, message) {
|
|
5309
|
-
return reject(message);
|
|
5310
|
-
});
|
|
5311
|
-
})
|
|
5312
|
-
];
|
|
5313
|
-
});
|
|
5314
|
-
}).call(this);
|
|
5315
|
-
};
|
|
5316
|
-
_proto.loadJsonAsync = function loadJsonAsync(path) {
|
|
5317
|
-
return _async_to_generator(function() {
|
|
5318
|
-
var _this;
|
|
5319
|
-
return __generator(this, function(_state) {
|
|
5320
|
-
_this = this;
|
|
5321
|
-
return [
|
|
5322
|
-
2,
|
|
5323
|
-
new Promise(function(resolve, reject) {
|
|
5324
|
-
_this.loadJson(path, function(_, object) {
|
|
5325
|
-
return resolve(object);
|
|
5326
|
-
}, function(_, message) {
|
|
5327
|
-
return reject(message);
|
|
5328
|
-
});
|
|
5329
|
-
})
|
|
5330
|
-
];
|
|
5331
|
-
});
|
|
5332
|
-
}).call(this);
|
|
5333
|
-
};
|
|
5334
|
-
_proto.loadTextureAsync = function loadTextureAsync(path) {
|
|
5335
|
-
return _async_to_generator(function() {
|
|
5336
|
-
var _this;
|
|
5337
|
-
return __generator(this, function(_state) {
|
|
5338
|
-
_this = this;
|
|
5339
|
-
return [
|
|
5340
|
-
2,
|
|
5341
|
-
new Promise(function(resolve, reject) {
|
|
5342
|
-
_this.loadTexture(path, function(_, texture) {
|
|
5343
|
-
return resolve(texture);
|
|
5344
|
-
}, function(_, message) {
|
|
5345
|
-
return reject(message);
|
|
5346
|
-
});
|
|
5347
|
-
})
|
|
5348
|
-
];
|
|
5349
|
-
});
|
|
5350
|
-
}).call(this);
|
|
5351
|
-
};
|
|
5352
|
-
_proto.loadTextureAtlasAsync = function loadTextureAtlasAsync(path) {
|
|
5353
|
-
return _async_to_generator(function() {
|
|
5354
|
-
var _this;
|
|
5355
|
-
return __generator(this, function(_state) {
|
|
5356
|
-
_this = this;
|
|
5357
|
-
return [
|
|
5358
|
-
2,
|
|
5359
|
-
new Promise(function(resolve, reject) {
|
|
5360
|
-
_this.loadTextureAtlas(path, function(_, atlas) {
|
|
5361
|
-
return resolve(atlas);
|
|
5362
|
-
}, function(_, message) {
|
|
5363
|
-
return reject(message);
|
|
5364
|
-
});
|
|
5365
|
-
})
|
|
5366
|
-
];
|
|
5367
|
-
});
|
|
5368
|
-
}).call(this);
|
|
5369
|
-
};
|
|
5370
|
-
_proto.loadTextureAtlasButNoTexturesAsync = function loadTextureAtlasButNoTexturesAsync(path) {
|
|
5371
|
-
return _async_to_generator(function() {
|
|
5372
|
-
var _this;
|
|
5373
|
-
return __generator(this, function(_state) {
|
|
5374
|
-
_this = this;
|
|
5375
|
-
return [
|
|
5376
|
-
2,
|
|
5377
|
-
new Promise(function(resolve, reject) {
|
|
5378
|
-
_this.loadTextureAtlasButNoTextures(path, function(_, atlas) {
|
|
5379
|
-
return resolve(atlas);
|
|
5380
|
-
}, function(_, message) {
|
|
5381
|
-
return reject(message);
|
|
5382
|
-
});
|
|
5383
|
-
})
|
|
5384
|
-
];
|
|
5385
|
-
});
|
|
5386
|
-
}).call(this);
|
|
5387
|
-
};
|
|
5388
|
-
_proto.setCache = function setCache(cache) {
|
|
5389
|
-
this.cache = cache;
|
|
5390
|
-
};
|
|
5391
5044
|
_proto.get = function get(path) {
|
|
5392
|
-
return this.
|
|
5045
|
+
return this.assets[this.pathPrefix + path];
|
|
5393
5046
|
};
|
|
5394
5047
|
_proto.require = function require(path) {
|
|
5395
5048
|
path = this.pathPrefix + path;
|
|
5396
|
-
var asset = this.
|
|
5049
|
+
var asset = this.assets[path];
|
|
5397
5050
|
if (asset) return asset;
|
|
5398
5051
|
var error = this.errors[path];
|
|
5399
5052
|
throw Error("Asset not found: " + path + (error ? "\n" + error : ""));
|
|
5400
5053
|
};
|
|
5401
5054
|
_proto.remove = function remove(path) {
|
|
5402
5055
|
path = this.pathPrefix + path;
|
|
5403
|
-
var asset = this.
|
|
5056
|
+
var asset = this.assets[path];
|
|
5404
5057
|
if (asset.dispose) asset.dispose();
|
|
5405
|
-
delete this.
|
|
5406
|
-
delete this.cache.assetsRefCount[path];
|
|
5407
|
-
delete this.cache.assetsLoaded[path];
|
|
5058
|
+
delete this.assets[path];
|
|
5408
5059
|
return asset;
|
|
5409
5060
|
};
|
|
5410
5061
|
_proto.removeAll = function removeAll() {
|
|
5411
|
-
for(var
|
|
5412
|
-
var asset = this.
|
|
5062
|
+
for(var key in this.assets){
|
|
5063
|
+
var asset = this.assets[key];
|
|
5413
5064
|
if (asset.dispose) asset.dispose();
|
|
5414
5065
|
}
|
|
5415
|
-
this.
|
|
5416
|
-
this.cache.assetsLoaded = {};
|
|
5417
|
-
this.cache.assetsRefCount = {};
|
|
5066
|
+
this.assets = {};
|
|
5418
5067
|
};
|
|
5419
5068
|
_proto.isLoadingComplete = function isLoadingComplete() {
|
|
5420
5069
|
return this.toLoad == 0;
|
|
@@ -5428,89 +5077,14 @@ var AssetManagerBase = /*#__PURE__*/ function() {
|
|
|
5428
5077
|
_proto.dispose = function dispose() {
|
|
5429
5078
|
this.removeAll();
|
|
5430
5079
|
};
|
|
5431
|
-
// dispose asset only if it's not used by others
|
|
5432
|
-
_proto.disposeAsset = function disposeAsset(path) {
|
|
5433
|
-
var asset = this.cache.assets[path];
|
|
5434
|
-
if (_instanceof1(asset, TextureAtlas)) {
|
|
5435
|
-
asset.dispose();
|
|
5436
|
-
return;
|
|
5437
|
-
}
|
|
5438
|
-
this.disposeAssetInternal(path);
|
|
5439
|
-
};
|
|
5440
5080
|
_proto.hasErrors = function hasErrors() {
|
|
5441
5081
|
return Object.keys(this.errors).length > 0;
|
|
5442
5082
|
};
|
|
5443
5083
|
_proto.getErrors = function getErrors() {
|
|
5444
5084
|
return this.errors;
|
|
5445
5085
|
};
|
|
5446
|
-
_proto.disposeAssetInternal = function disposeAssetInternal(path) {
|
|
5447
|
-
if (this.cache.assetsRefCount[path] > 0 && --this.cache.assetsRefCount[path] === 0) {
|
|
5448
|
-
return this.remove(path);
|
|
5449
|
-
}
|
|
5450
|
-
};
|
|
5451
|
-
_proto.createTextureAtlas = function createTextureAtlas(path, atlasText) {
|
|
5452
|
-
var _this = this;
|
|
5453
|
-
var atlas = new TextureAtlas(atlasText);
|
|
5454
|
-
atlas.dispose = function() {
|
|
5455
|
-
if (_this.cache.assetsRefCount[path] <= 0) return;
|
|
5456
|
-
_this.disposeAssetInternal(path);
|
|
5457
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(atlas.pages), _step; !(_step = _iterator()).done;){
|
|
5458
|
-
var page = _step.value;
|
|
5459
|
-
var _page_texture;
|
|
5460
|
-
(_page_texture = page.texture) == null ? void 0 : _page_texture.dispose();
|
|
5461
|
-
}
|
|
5462
|
-
};
|
|
5463
|
-
return atlas;
|
|
5464
|
-
};
|
|
5465
|
-
_proto.createTexture = function createTexture(path, image) {
|
|
5466
|
-
var _this = this;
|
|
5467
|
-
var texture = this.textureLoader(image);
|
|
5468
|
-
var textureDispose = texture.dispose.bind(texture);
|
|
5469
|
-
texture.dispose = function() {
|
|
5470
|
-
if (_this.disposeAssetInternal(path)) textureDispose();
|
|
5471
|
-
};
|
|
5472
|
-
return texture;
|
|
5473
|
-
};
|
|
5474
5086
|
return AssetManagerBase;
|
|
5475
5087
|
}();
|
|
5476
|
-
var AssetCache = /*#__PURE__*/ function() {
|
|
5477
|
-
function AssetCache() {
|
|
5478
|
-
this.assets = {};
|
|
5479
|
-
this.assetsRefCount = {};
|
|
5480
|
-
this.assetsLoaded = {};
|
|
5481
|
-
}
|
|
5482
|
-
var _proto = AssetCache.prototype;
|
|
5483
|
-
_proto.addAsset = function addAsset(path, asset) {
|
|
5484
|
-
return _async_to_generator(function() {
|
|
5485
|
-
var _;
|
|
5486
|
-
return __generator(this, function(_state) {
|
|
5487
|
-
switch(_state.label){
|
|
5488
|
-
case 0:
|
|
5489
|
-
this.assetsLoaded[path] = Promise.resolve(asset);
|
|
5490
|
-
_ = this.assets;
|
|
5491
|
-
return [
|
|
5492
|
-
4,
|
|
5493
|
-
asset
|
|
5494
|
-
];
|
|
5495
|
-
case 1:
|
|
5496
|
-
_[path] = _state.sent();
|
|
5497
|
-
return [
|
|
5498
|
-
2
|
|
5499
|
-
];
|
|
5500
|
-
}
|
|
5501
|
-
});
|
|
5502
|
-
}).call(this);
|
|
5503
|
-
};
|
|
5504
|
-
AssetCache.getCache = function getCache(id) {
|
|
5505
|
-
var cache = AssetCache.AVAILABLE_CACHES.get(id);
|
|
5506
|
-
if (cache) return cache;
|
|
5507
|
-
var newCache = new AssetCache();
|
|
5508
|
-
AssetCache.AVAILABLE_CACHES.set(id, newCache);
|
|
5509
|
-
return newCache;
|
|
5510
|
-
};
|
|
5511
|
-
return AssetCache;
|
|
5512
|
-
}();
|
|
5513
|
-
AssetCache.AVAILABLE_CACHES = new Map();
|
|
5514
5088
|
var Downloader = /*#__PURE__*/ function() {
|
|
5515
5089
|
function Downloader() {
|
|
5516
5090
|
this.callbacks = {};
|
|
@@ -5550,11 +5124,10 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5550
5124
|
_proto.downloadText = function downloadText(url, success, error) {
|
|
5551
5125
|
var _this = this;
|
|
5552
5126
|
if (this.start(url, success, error)) return;
|
|
5553
|
-
|
|
5554
|
-
// we assume if a "." is included in a raw data uri, it is used to rewrite an asset URL
|
|
5555
|
-
if (rawDataUri && !rawDataUri.includes(".")) {
|
|
5127
|
+
if (this.rawDataUris[url]) {
|
|
5556
5128
|
try {
|
|
5557
|
-
|
|
5129
|
+
var dataUri = this.rawDataUris[url];
|
|
5130
|
+
this.finish(url, 200, this.dataUriToString(dataUri));
|
|
5558
5131
|
} catch (e) {
|
|
5559
5132
|
this.finish(url, 400, JSON.stringify(e));
|
|
5560
5133
|
}
|
|
@@ -5562,7 +5135,7 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5562
5135
|
}
|
|
5563
5136
|
var request = new XMLHttpRequest();
|
|
5564
5137
|
request.overrideMimeType("text/html");
|
|
5565
|
-
request.open("GET",
|
|
5138
|
+
request.open("GET", url, true);
|
|
5566
5139
|
var done = function() {
|
|
5567
5140
|
_this.finish(url, request.status, request.responseText);
|
|
5568
5141
|
};
|
|
@@ -5578,18 +5151,17 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5578
5151
|
_proto.downloadBinary = function downloadBinary(url, success, error) {
|
|
5579
5152
|
var _this = this;
|
|
5580
5153
|
if (this.start(url, success, error)) return;
|
|
5581
|
-
|
|
5582
|
-
// we assume if a "." is included in a raw data uri, it is used to rewrite an asset URL
|
|
5583
|
-
if (rawDataUri && !rawDataUri.includes(".")) {
|
|
5154
|
+
if (this.rawDataUris[url]) {
|
|
5584
5155
|
try {
|
|
5585
|
-
|
|
5156
|
+
var dataUri = this.rawDataUris[url];
|
|
5157
|
+
this.finish(url, 200, this.dataUriToUint8Array(dataUri));
|
|
5586
5158
|
} catch (e) {
|
|
5587
5159
|
this.finish(url, 400, JSON.stringify(e));
|
|
5588
5160
|
}
|
|
5589
5161
|
return;
|
|
5590
5162
|
}
|
|
5591
5163
|
var request = new XMLHttpRequest();
|
|
5592
|
-
request.open("GET",
|
|
5164
|
+
request.open("GET", url, true);
|
|
5593
5165
|
request.responseType = "arraybuffer";
|
|
5594
5166
|
var onerror = function() {
|
|
5595
5167
|
_this.finish(url, request.status, request.response);
|
|
@@ -5627,17 +5199,17 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5627
5199
|
|
|
5628
5200
|
/******************************************************************************
|
|
5629
5201
|
* Spine Runtimes License Agreement
|
|
5630
|
-
* Last updated
|
|
5202
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
5631
5203
|
*
|
|
5632
|
-
* Copyright (c) 2013-
|
|
5204
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
5633
5205
|
*
|
|
5634
5206
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
5635
5207
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
5636
5208
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
5637
5209
|
* http://esotericsoftware.com/spine-editor-license
|
|
5638
5210
|
*
|
|
5639
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
5640
|
-
*
|
|
5211
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
5212
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
5641
5213
|
* "Products"), provided that each user of the Products must obtain their own
|
|
5642
5214
|
* Spine Editor license and redistribution of the Products in any form must
|
|
5643
5215
|
* include this license and copyright notice.
|
|
@@ -5650,8 +5222,8 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5650
5222
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
5651
5223
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
5652
5224
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
5653
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
5654
|
-
*
|
|
5225
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
5226
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
5655
5227
|
*****************************************************************************/ /** Stores the current pose values for an {@link Event}.
|
|
5656
5228
|
*
|
|
5657
5229
|
* See Timeline {@link Timeline#apply()},
|
|
@@ -5671,17 +5243,17 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5671
5243
|
|
|
5672
5244
|
/******************************************************************************
|
|
5673
5245
|
* Spine Runtimes License Agreement
|
|
5674
|
-
* Last updated
|
|
5246
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
5675
5247
|
*
|
|
5676
|
-
* Copyright (c) 2013-
|
|
5248
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
5677
5249
|
*
|
|
5678
5250
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
5679
5251
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
5680
5252
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
5681
5253
|
* http://esotericsoftware.com/spine-editor-license
|
|
5682
5254
|
*
|
|
5683
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
5684
|
-
*
|
|
5255
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
5256
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
5685
5257
|
* "Products"), provided that each user of the Products must obtain their own
|
|
5686
5258
|
* Spine Editor license and redistribution of the Products in any form must
|
|
5687
5259
|
* include this license and copyright notice.
|
|
@@ -5694,8 +5266,8 @@ var Downloader = /*#__PURE__*/ function() {
|
|
|
5694
5266
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
5695
5267
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
5696
5268
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
5697
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
5698
|
-
*
|
|
5269
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
5270
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
5699
5271
|
*****************************************************************************/ /** Stores the setup pose values for an {@link Event}.
|
|
5700
5272
|
*
|
|
5701
5273
|
* See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */ var EventData = function EventData(name) {
|
|
@@ -6555,7 +6127,7 @@ PathConstraint.epsilon = 0.00001;
|
|
|
6555
6127
|
}
|
|
6556
6128
|
if (a >= t) {
|
|
6557
6129
|
d = Math.pow(this.damping, 60 * t);
|
|
6558
|
-
var m = this.massInverse * t, e = this.strength, w = this.wind * f
|
|
6130
|
+
var m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
|
|
6559
6131
|
do {
|
|
6560
6132
|
if (x) {
|
|
6561
6133
|
this.xVelocity += (w - this.xOffset * e) * m;
|
|
@@ -7397,10 +6969,10 @@ PathConstraint.epsilon = 0.00001;
|
|
|
7397
6969
|
})) != null ? _this_physicsConstraints_find : null;
|
|
7398
6970
|
};
|
|
7399
6971
|
/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.
|
|
7400
|
-
* Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */ _proto.getBoundsRect = function getBoundsRect(
|
|
6972
|
+
* Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */ _proto.getBoundsRect = function getBoundsRect() {
|
|
7401
6973
|
var offset = new Vector2();
|
|
7402
6974
|
var size = new Vector2();
|
|
7403
|
-
this.getBounds(offset, size
|
|
6975
|
+
this.getBounds(offset, size);
|
|
7404
6976
|
return {
|
|
7405
6977
|
x: offset.x,
|
|
7406
6978
|
y: offset.y,
|
|
@@ -7529,17 +7101,17 @@ Skeleton.yDown = false;
|
|
|
7529
7101
|
|
|
7530
7102
|
/******************************************************************************
|
|
7531
7103
|
* Spine Runtimes License Agreement
|
|
7532
|
-
* Last updated
|
|
7104
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
7533
7105
|
*
|
|
7534
|
-
* Copyright (c) 2013-
|
|
7106
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
7535
7107
|
*
|
|
7536
7108
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
7537
7109
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
7538
7110
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
7539
7111
|
* http://esotericsoftware.com/spine-editor-license
|
|
7540
7112
|
*
|
|
7541
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
7542
|
-
*
|
|
7113
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
7114
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
7543
7115
|
* "Products"), provided that each user of the Products must obtain their own
|
|
7544
7116
|
* Spine Editor license and redistribution of the Products in any form must
|
|
7545
7117
|
* include this license and copyright notice.
|
|
@@ -7552,16 +7124,18 @@ Skeleton.yDown = false;
|
|
|
7552
7124
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
7553
7125
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
7554
7126
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
7555
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
7556
|
-
*
|
|
7127
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
7128
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
7557
7129
|
*****************************************************************************/ /** Stores the setup pose and all of the stateless data for a skeleton.
|
|
7558
7130
|
*
|
|
7559
7131
|
* See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes
|
|
7560
7132
|
* Guide. */ var SkeletonData = /*#__PURE__*/ function() {
|
|
7561
7133
|
function SkeletonData() {
|
|
7562
7134
|
/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */ this.name = null;
|
|
7563
|
-
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ this.bones = new Array()
|
|
7564
|
-
|
|
7135
|
+
/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ this.bones = new Array() // Ordered parents first.
|
|
7136
|
+
;
|
|
7137
|
+
/** The skeleton's slots in the setup pose draw order. */ this.slots = new Array() // Setup pose draw order.
|
|
7138
|
+
;
|
|
7565
7139
|
this.skins = new Array();
|
|
7566
7140
|
/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.
|
|
7567
7141
|
*
|
|
@@ -7704,7 +7278,8 @@ Skeleton.yDown = false;
|
|
|
7704
7278
|
this.attachments = new Array();
|
|
7705
7279
|
this.bones = Array();
|
|
7706
7280
|
this.constraints = new Array();
|
|
7707
|
-
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */ this.color = new Color(0.99607843, 0.61960787, 0.30980393, 1)
|
|
7281
|
+
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */ this.color = new Color(0.99607843, 0.61960787, 0.30980393, 1) // fe9e4fff
|
|
7282
|
+
;
|
|
7708
7283
|
if (!name) throw new Error("name cannot be null.");
|
|
7709
7284
|
this.name = name;
|
|
7710
7285
|
}
|
|
@@ -10862,17 +10437,17 @@ function getValue(map, property, defaultValue) {
|
|
|
10862
10437
|
|
|
10863
10438
|
/******************************************************************************
|
|
10864
10439
|
* Spine Runtimes License Agreement
|
|
10865
|
-
* Last updated
|
|
10440
|
+
* Last updated July 28, 2023. Replaces all prior versions.
|
|
10866
10441
|
*
|
|
10867
|
-
* Copyright (c) 2013-
|
|
10442
|
+
* Copyright (c) 2013-2023, Esoteric Software LLC
|
|
10868
10443
|
*
|
|
10869
10444
|
* Integration of the Spine Runtimes into software or otherwise creating
|
|
10870
10445
|
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
10871
10446
|
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10872
10447
|
* http://esotericsoftware.com/spine-editor-license
|
|
10873
10448
|
*
|
|
10874
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
10875
|
-
*
|
|
10449
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software or
|
|
10450
|
+
* otherwise create derivative works of the Spine Runtimes (collectively,
|
|
10876
10451
|
* "Products"), provided that each user of the Products must obtain their own
|
|
10877
10452
|
* Spine Editor license and redistribution of the Products in any form must
|
|
10878
10453
|
* include this license and copyright notice.
|
|
@@ -10885,8 +10460,8 @@ function getValue(map, property, defaultValue) {
|
|
|
10885
10460
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
10886
10461
|
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
10887
10462
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
10888
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
10889
|
-
*
|
|
10463
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE
|
|
10464
|
+
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
10890
10465
|
*****************************************************************************/ (function() {
|
|
10891
10466
|
if (typeof Math.fround === "undefined") {
|
|
10892
10467
|
Math.fround = function(array) {
|
|
@@ -12139,7 +11714,7 @@ for(var key in RendererObject){
|
|
|
12139
11714
|
for(var key1 in LoaderObject){
|
|
12140
11715
|
engine.Loader.registerClass(key1, LoaderObject[key1]);
|
|
12141
11716
|
}
|
|
12142
|
-
var version = "4.2.
|
|
11717
|
+
var version = "4.2.8";
|
|
12143
11718
|
console.log("Galacean spine version: " + version);
|
|
12144
11719
|
|
|
12145
11720
|
exports.AlphaTimeline = AlphaTimeline;
|
|
@@ -12147,7 +11722,6 @@ exports.Animation = Animation;
|
|
|
12147
11722
|
exports.AnimationState = AnimationState;
|
|
12148
11723
|
exports.AnimationStateAdapter = AnimationStateAdapter;
|
|
12149
11724
|
exports.AnimationStateData = AnimationStateData;
|
|
12150
|
-
exports.AssetCache = AssetCache;
|
|
12151
11725
|
exports.AssetManagerBase = AssetManagerBase;
|
|
12152
11726
|
exports.AtlasAttachmentLoader = AtlasAttachmentLoader;
|
|
12153
11727
|
exports.Attachment = Attachment;
|