@eva/plugin-renderer-spine 1.2.6 → 1.2.7-editor.2
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.
|
@@ -4,9 +4,180 @@ window.EVA = window.EVA || {};
|
|
|
4
4
|
window.EVA.plugin = window.EVA.plugin || {};
|
|
5
5
|
window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
|
|
6
6
|
|
|
7
|
-
var _EVA_IIFE_spine = function (exports,
|
|
7
|
+
var _EVA_IIFE_spine = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
var _extendStatics$ = function extendStatics$2(d, b) {
|
|
11
|
+
_extendStatics$ = Object.setPrototypeOf || {
|
|
12
|
+
__proto__: []
|
|
13
|
+
} instanceof Array && function (d, b) {
|
|
14
|
+
d.__proto__ = b;
|
|
15
|
+
} || function (d, b) {
|
|
16
|
+
for (var p in b) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return _extendStatics$(d, b);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function __extends$3(d, b) {
|
|
25
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
+
|
|
27
|
+
_extendStatics$(d, b);
|
|
28
|
+
|
|
29
|
+
function __() {
|
|
30
|
+
this.constructor = d;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var _extendStatics$2 = function extendStatics$1(d, b) {
|
|
37
|
+
_extendStatics$2 = Object.setPrototypeOf || {
|
|
38
|
+
__proto__: []
|
|
39
|
+
} instanceof Array && function (d, b) {
|
|
40
|
+
d.__proto__ = b;
|
|
41
|
+
} || function (d, b) {
|
|
42
|
+
for (var p in b) {
|
|
43
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return _extendStatics$2(d, b);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function __extends$2(d, b) {
|
|
51
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
52
|
+
|
|
53
|
+
_extendStatics$2(d, b);
|
|
54
|
+
|
|
55
|
+
function __() {
|
|
56
|
+
this.constructor = d;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var _assign = function __assign() {
|
|
63
|
+
_assign = Object.assign || function __assign(t) {
|
|
64
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
65
|
+
s = arguments[i];
|
|
66
|
+
|
|
67
|
+
for (var p in s) {
|
|
68
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return t;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return _assign.apply(this, arguments);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var SymbolKeysNotSupportedError = function (_super) {
|
|
79
|
+
__extends$2(SymbolKeysNotSupportedError, _super);
|
|
80
|
+
|
|
81
|
+
function SymbolKeysNotSupportedError() {
|
|
82
|
+
var _newTarget = this.constructor;
|
|
83
|
+
|
|
84
|
+
var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
|
|
85
|
+
|
|
86
|
+
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
87
|
+
return _this;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return SymbolKeysNotSupportedError;
|
|
91
|
+
}(Error);
|
|
92
|
+
|
|
93
|
+
(function (_super) {
|
|
94
|
+
__extends$2(StaticGetPropertiesIsNotAFunctionError, _super);
|
|
95
|
+
|
|
96
|
+
function StaticGetPropertiesIsNotAFunctionError() {
|
|
97
|
+
var _newTarget = this.constructor;
|
|
98
|
+
|
|
99
|
+
var _this = _super.call(this, 'getProperties is not a function!') || this;
|
|
100
|
+
|
|
101
|
+
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
102
|
+
return _this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return StaticGetPropertiesIsNotAFunctionError;
|
|
106
|
+
})(Error);
|
|
107
|
+
|
|
108
|
+
var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
|
|
109
|
+
|
|
110
|
+
function transformBasicType(type) {
|
|
111
|
+
if (type === String) {
|
|
112
|
+
return 'string';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (type === Number) {
|
|
116
|
+
return 'number';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (type === Boolean) {
|
|
120
|
+
return 'boolean';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return 'unknown';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function defineTypes(target, key, options, returnTypeFunction) {
|
|
127
|
+
var type = Reflect.getMetadata('design:type', target, key);
|
|
128
|
+
var isArray = type === Array;
|
|
129
|
+
var str = transformBasicType(type);
|
|
130
|
+
|
|
131
|
+
if (str !== 'unknown') {
|
|
132
|
+
type = str;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (returnTypeFunction) {
|
|
136
|
+
var returnType = returnTypeFunction();
|
|
137
|
+
|
|
138
|
+
if (Array.isArray(returnType)) {
|
|
139
|
+
isArray = true;
|
|
140
|
+
type = returnType[0];
|
|
141
|
+
} else {
|
|
142
|
+
type = returnType;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
|
|
147
|
+
properties[key] = _assign({
|
|
148
|
+
type: type,
|
|
149
|
+
isArray: isArray
|
|
150
|
+
}, options);
|
|
151
|
+
Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
155
|
+
if (typeof returnTypeFuncOrOptions === 'function') {
|
|
156
|
+
return {
|
|
157
|
+
returnTypeFunc: returnTypeFuncOrOptions,
|
|
158
|
+
options: maybeOptions || {}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
options: returnTypeFuncOrOptions || {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function Field(returnTypeFunction, maybeOptions) {
|
|
168
|
+
return function (target, propertyKey) {
|
|
169
|
+
if (typeof propertyKey === 'symbol') {
|
|
170
|
+
throw new SymbolKeysNotSupportedError();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
|
|
174
|
+
options = _a.options,
|
|
175
|
+
returnTypeFunc = _a.returnTypeFunc;
|
|
176
|
+
|
|
177
|
+
defineTypes(target, propertyKey, options, returnTypeFunc);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
10
181
|
var _extendStatics = function extendStatics(d, b) {
|
|
11
182
|
_extendStatics = Object.setPrototypeOf || {
|
|
12
183
|
__proto__: []
|
|
@@ -41,13 +212,11 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
41
212
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
42
213
|
}
|
|
43
214
|
|
|
44
|
-
function
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
resolve(value);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
215
|
+
function __metadata(metadataKey, metadataValue) {
|
|
216
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
217
|
+
}
|
|
50
218
|
|
|
219
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
51
220
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
52
221
|
function fulfilled(value) {
|
|
53
222
|
try {
|
|
@@ -66,7 +235,9 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
66
235
|
}
|
|
67
236
|
|
|
68
237
|
function step(result) {
|
|
69
|
-
result.done ? resolve(result.value) :
|
|
238
|
+
result.done ? resolve(result.value) : new P(function (resolve) {
|
|
239
|
+
resolve(result.value);
|
|
240
|
+
}).then(fulfilled, rejected);
|
|
70
241
|
}
|
|
71
242
|
|
|
72
243
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
@@ -185,11 +356,10 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
185
356
|
}
|
|
186
357
|
|
|
187
358
|
function __values(o) {
|
|
188
|
-
var
|
|
189
|
-
m = s && o[s],
|
|
359
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator],
|
|
190
360
|
i = 0;
|
|
191
361
|
if (m) return m.call(o);
|
|
192
|
-
|
|
362
|
+
return {
|
|
193
363
|
next: function next() {
|
|
194
364
|
if (o && i >= o.length) o = void 0;
|
|
195
365
|
return {
|
|
@@ -198,28 +368,6 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
198
368
|
};
|
|
199
369
|
}
|
|
200
370
|
};
|
|
201
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function getIDEPropsPropertyObj(target, propertyKey) {
|
|
205
|
-
if (!target.constructor.IDEProps) {
|
|
206
|
-
target.constructor.IDEProps = {};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (!target.constructor.IDEProps[propertyKey]) {
|
|
210
|
-
target.constructor.IDEProps[propertyKey] = {};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var propertyObj = target.constructor.IDEProps[propertyKey];
|
|
214
|
-
return propertyObj;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function type(type) {
|
|
218
|
-
return function (target, propertyKey) {
|
|
219
|
-
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
220
|
-
prop.key = propertyKey;
|
|
221
|
-
prop.type = type;
|
|
222
|
-
};
|
|
223
371
|
}
|
|
224
372
|
|
|
225
373
|
var Spine$2 = function (_super) {
|
|
@@ -387,16 +535,16 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
387
535
|
|
|
388
536
|
Spine.componentName = 'Spine';
|
|
389
537
|
|
|
390
|
-
__decorate([
|
|
538
|
+
__decorate([Field(), __metadata("design:type", String)], Spine.prototype, "resource", void 0);
|
|
391
539
|
|
|
392
|
-
__decorate([
|
|
540
|
+
__decorate([Field(), __metadata("design:type", String)], Spine.prototype, "animationName", void 0);
|
|
393
541
|
|
|
394
|
-
__decorate([
|
|
542
|
+
__decorate([Field(), __metadata("design:type", Boolean)], Spine.prototype, "autoPlay", void 0);
|
|
395
543
|
|
|
396
544
|
return Spine;
|
|
397
545
|
}(eva_js.Component);
|
|
398
546
|
|
|
399
|
-
var
|
|
547
|
+
var Spine$1$1 = Spine$2;
|
|
400
548
|
var texCache = {};
|
|
401
549
|
|
|
402
550
|
function cacheImage(data) {
|
|
@@ -544,21 +692,21 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
544
692
|
var obj = objs[i];
|
|
545
693
|
|
|
546
694
|
if (obj.id === id) {
|
|
547
|
-
var sp = obj.getComponent(
|
|
695
|
+
var sp = obj.getComponent(Spine$1$1);
|
|
548
696
|
|
|
549
697
|
if (sp) {
|
|
550
698
|
_this.remove({
|
|
551
699
|
type: eva_js.OBSERVER_TYPE.REMOVE,
|
|
552
700
|
gameObject: obj,
|
|
553
701
|
component: sp,
|
|
554
|
-
componentName:
|
|
702
|
+
componentName: Spine$1$1.componentName
|
|
555
703
|
});
|
|
556
704
|
|
|
557
705
|
toAdd.push({
|
|
558
706
|
type: eva_js.OBSERVER_TYPE.ADD,
|
|
559
707
|
gameObject: obj,
|
|
560
708
|
component: sp,
|
|
561
|
-
componentName:
|
|
709
|
+
componentName: Spine$1$1.componentName
|
|
562
710
|
});
|
|
563
711
|
}
|
|
564
712
|
|
|
@@ -610,7 +758,7 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
610
758
|
var _a, _b;
|
|
611
759
|
|
|
612
760
|
return __awaiter(this, void 0, void 0, function () {
|
|
613
|
-
var component, res, spineData, container, armature, tran;
|
|
761
|
+
var component, gameObjectId, asyncId, res, spineData, container, armature, tran;
|
|
614
762
|
|
|
615
763
|
var _this = this;
|
|
616
764
|
|
|
@@ -619,14 +767,18 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
619
767
|
case 0:
|
|
620
768
|
component = changed.component;
|
|
621
769
|
clearTimeout(component.addHandler);
|
|
770
|
+
gameObjectId = changed.gameObject.id;
|
|
771
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
622
772
|
return [4, eva_js.resource.getResource(component.resource)];
|
|
623
773
|
|
|
624
774
|
case 1:
|
|
625
775
|
res = _c.sent();
|
|
776
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
|
|
626
777
|
return [4, getSpineData(res, this.pixiSpine)];
|
|
627
778
|
|
|
628
779
|
case 2:
|
|
629
780
|
spineData = _c.sent();
|
|
781
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
|
|
630
782
|
|
|
631
783
|
if (!spineData) {
|
|
632
784
|
component.addHandler = setTimeout(function () {
|
|
@@ -719,6 +871,7 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
719
871
|
return __generator(this, function (_e) {
|
|
720
872
|
switch (_e.label) {
|
|
721
873
|
case 0:
|
|
874
|
+
this.increaseAsyncId(changed.gameObject.id);
|
|
722
875
|
component = changed.component;
|
|
723
876
|
clearTimeout(component.addHandler);
|
|
724
877
|
armature = this.armatures[changed.gameObject.id];
|
|
@@ -756,7 +909,8 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
756
909
|
return SpineSystem;
|
|
757
910
|
}(pluginRenderer.Renderer);
|
|
758
911
|
|
|
759
|
-
var
|
|
912
|
+
var SpineSystem$1$1 = SpineSystem$2;
|
|
913
|
+
eva_js.resource.registerResourceType('SPINE');
|
|
760
914
|
var VERSION = '4.8.9';
|
|
761
915
|
var loader = pixi_js.loaders.shared;
|
|
762
916
|
var PIXI = {
|
|
@@ -9552,9 +9706,9 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
9552
9706
|
var cachedResource = loader.resources[name];
|
|
9553
9707
|
|
|
9554
9708
|
if (cachedResource) {
|
|
9555
|
-
|
|
9709
|
+
function done() {
|
|
9556
9710
|
callback(cachedResource.texture.baseTexture);
|
|
9557
|
-
}
|
|
9711
|
+
}
|
|
9558
9712
|
|
|
9559
9713
|
if (cachedResource.texture) {
|
|
9560
9714
|
done();
|
|
@@ -9605,7 +9759,7 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
9605
9759
|
var pixiSpine = pixi_spine;
|
|
9606
9760
|
|
|
9607
9761
|
var SpineSystem = function (_super) {
|
|
9608
|
-
__extends$
|
|
9762
|
+
__extends$3(SpineSystem, _super);
|
|
9609
9763
|
|
|
9610
9764
|
function SpineSystem() {
|
|
9611
9765
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -9618,19 +9772,19 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
9618
9772
|
};
|
|
9619
9773
|
|
|
9620
9774
|
return SpineSystem;
|
|
9621
|
-
}(
|
|
9775
|
+
}(SpineSystem$1$1);
|
|
9622
9776
|
|
|
9623
9777
|
var SpineSystem$1 = SpineSystem;
|
|
9624
9778
|
|
|
9625
9779
|
var Spine = function (_super) {
|
|
9626
|
-
__extends$
|
|
9780
|
+
__extends$3(Spine, _super);
|
|
9627
9781
|
|
|
9628
9782
|
function Spine() {
|
|
9629
9783
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
9630
9784
|
}
|
|
9631
9785
|
|
|
9632
9786
|
return Spine;
|
|
9633
|
-
}(
|
|
9787
|
+
}(Spine$1$1);
|
|
9634
9788
|
|
|
9635
9789
|
var Spine$1 = Spine;
|
|
9636
9790
|
exports.Spine = Spine$1;
|
|
@@ -9639,6 +9793,6 @@ var _EVA_IIFE_spine = function (exports, pixi_js, eva_js, pluginRenderer) {
|
|
|
9639
9793
|
value: true
|
|
9640
9794
|
});
|
|
9641
9795
|
return exports;
|
|
9642
|
-
}({},
|
|
9796
|
+
}({}, EVA, EVA.plugin.renderer, PIXI);
|
|
9643
9797
|
|
|
9644
9798
|
window.EVA.plugin.renderer.spine = window.EVA.plugin.renderer.spine || _EVA_IIFE_spine;
|