@eva/spine-base 1.2.8 → 2.0.0-beta.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.
@@ -1,52 +1,38 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
2
  window.EVA = window.EVA || {};
4
3
  window.EVA.plugin = window.EVA.plugin || {};
5
-
6
4
  var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
7
5
  'use strict';
8
-
9
- var _extendStatics = function extendStatics(d, b) {
10
- _extendStatics = Object.setPrototypeOf || {
6
+ var extendStatics = function (d, b) {
7
+ extendStatics = Object.setPrototypeOf || {
11
8
  __proto__: []
12
9
  } instanceof Array && function (d, b) {
13
10
  d.__proto__ = b;
14
11
  } || function (d, b) {
15
- for (var p in b) {
16
- if (b.hasOwnProperty(p)) d[p] = b[p];
17
- }
12
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
18
13
  };
19
-
20
- return _extendStatics(d, b);
14
+ return extendStatics(d, b);
21
15
  };
22
-
23
16
  function __extends(d, b) {
24
- _extendStatics(d, b);
25
-
17
+ extendStatics(d, b);
26
18
  function __() {
27
19
  this.constructor = d;
28
20
  }
29
-
30
21
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
31
22
  }
32
-
33
23
  function __decorate(decorators, target, key, desc) {
34
24
  var c = arguments.length,
35
- r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
36
- d;
37
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
38
- if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
39
- }
25
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
26
+ d;
27
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
40
28
  return c > 3 && r && Object.defineProperty(target, key, r), r;
41
29
  }
42
-
43
30
  function __awaiter(thisArg, _arguments, P, generator) {
44
31
  function adopt(value) {
45
32
  return value instanceof P ? value : new P(function (resolve) {
46
33
  resolve(value);
47
34
  });
48
35
  }
49
-
50
36
  return new (P || (P = Promise))(function (resolve, reject) {
51
37
  function fulfilled(value) {
52
38
  try {
@@ -55,7 +41,6 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
55
41
  reject(e);
56
42
  }
57
43
  }
58
-
59
44
  function rejected(value) {
60
45
  try {
61
46
  step(generator["throw"](value));
@@ -63,29 +48,26 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
63
48
  reject(e);
64
49
  }
65
50
  }
66
-
67
51
  function step(result) {
68
52
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
69
53
  }
70
-
71
54
  step((generator = generator.apply(thisArg, _arguments || [])).next());
72
55
  });
73
56
  }
74
-
75
57
  function __generator(thisArg, body) {
76
58
  var _ = {
77
- label: 0,
78
- sent: function sent() {
79
- if (t[0] & 1) throw t[1];
80
- return t[1];
59
+ label: 0,
60
+ sent: function () {
61
+ if (t[0] & 1) throw t[1];
62
+ return t[1];
63
+ },
64
+ trys: [],
65
+ ops: []
81
66
  },
82
- trys: [],
83
- ops: []
84
- },
85
- f,
86
- y,
87
- t,
88
- g;
67
+ f,
68
+ y,
69
+ t,
70
+ g;
89
71
  return g = {
90
72
  next: verb(0),
91
73
  "throw": verb(1),
@@ -93,88 +75,66 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
93
75
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
94
76
  return this;
95
77
  }), g;
96
-
97
78
  function verb(n) {
98
79
  return function (v) {
99
80
  return step([n, v]);
100
81
  };
101
82
  }
102
-
103
83
  function step(op) {
104
84
  if (f) throw new TypeError("Generator is already executing.");
105
-
106
- while (_) {
107
- try {
108
- 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;
109
- if (y = 0, t) op = [op[0] & 2, t.value];
110
-
111
- switch (op[0]) {
112
- case 0:
113
- case 1:
85
+ while (_) try {
86
+ 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;
87
+ if (y = 0, t) op = [op[0] & 2, t.value];
88
+ switch (op[0]) {
89
+ case 0:
90
+ case 1:
91
+ t = op;
92
+ break;
93
+ case 4:
94
+ _.label++;
95
+ return {
96
+ value: op[1],
97
+ done: false
98
+ };
99
+ case 5:
100
+ _.label++;
101
+ y = op[1];
102
+ op = [0];
103
+ continue;
104
+ case 7:
105
+ op = _.ops.pop();
106
+ _.trys.pop();
107
+ continue;
108
+ default:
109
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
110
+ _ = 0;
111
+ continue;
112
+ }
113
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
114
+ _.label = op[1];
115
+ break;
116
+ }
117
+ if (op[0] === 6 && _.label < t[1]) {
118
+ _.label = t[1];
114
119
  t = op;
115
120
  break;
116
-
117
- case 4:
118
- _.label++;
119
- return {
120
- value: op[1],
121
- done: false
122
- };
123
-
124
- case 5:
125
- _.label++;
126
- y = op[1];
127
- op = [0];
128
- continue;
129
-
130
- case 7:
131
- op = _.ops.pop();
132
-
133
- _.trys.pop();
134
-
135
- continue;
136
-
137
- default:
138
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
139
- _ = 0;
140
- continue;
141
- }
142
-
143
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
144
- _.label = op[1];
145
- break;
146
- }
147
-
148
- if (op[0] === 6 && _.label < t[1]) {
149
- _.label = t[1];
150
- t = op;
151
- break;
152
- }
153
-
154
- if (t && _.label < t[2]) {
155
- _.label = t[2];
156
-
157
- _.ops.push(op);
158
-
159
- break;
160
- }
161
-
162
- if (t[2]) _.ops.pop();
163
-
164
- _.trys.pop();
165
-
166
- continue;
167
- }
168
-
169
- op = body.call(thisArg, _);
170
- } catch (e) {
171
- op = [6, e];
172
- y = 0;
173
- } finally {
174
- f = t = 0;
121
+ }
122
+ if (t && _.label < t[2]) {
123
+ _.label = t[2];
124
+ _.ops.push(op);
125
+ break;
126
+ }
127
+ if (t[2]) _.ops.pop();
128
+ _.trys.pop();
129
+ continue;
175
130
  }
131
+ op = body.call(thisArg, _);
132
+ } catch (e) {
133
+ op = [6, e];
134
+ y = 0;
135
+ } finally {
136
+ f = t = 0;
176
137
  }
177
-
178
138
  if (op[0] & 5) throw op[1];
179
139
  return {
180
140
  value: op[0] ? op[1] : void 0,
@@ -182,14 +142,13 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
182
142
  };
183
143
  }
184
144
  }
185
-
186
145
  function __values(o) {
187
146
  var s = typeof Symbol === "function" && Symbol.iterator,
188
- m = s && o[s],
189
- i = 0;
147
+ m = s && o[s],
148
+ i = 0;
190
149
  if (m) return m.call(o);
191
150
  if (o && typeof o.length === "number") return {
192
- next: function next() {
151
+ next: function () {
193
152
  if (o && i >= o.length) o = void 0;
194
153
  return {
195
154
  value: o && o[i++],
@@ -199,20 +158,16 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
199
158
  };
200
159
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
201
160
  }
202
-
203
161
  function getIDEPropsPropertyObj(target, propertyKey) {
204
162
  if (!target.constructor.IDEProps) {
205
163
  target.constructor.IDEProps = {};
206
164
  }
207
-
208
165
  if (!target.constructor.IDEProps[propertyKey]) {
209
166
  target.constructor.IDEProps[propertyKey] = {};
210
167
  }
211
-
212
168
  var propertyObj = target.constructor.IDEProps[propertyKey];
213
169
  return propertyObj;
214
170
  }
215
-
216
171
  function type(type) {
217
172
  return function (target, propertyKey) {
218
173
  var prop = getIDEPropsPropertyObj(target, propertyKey);
@@ -220,42 +175,35 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
220
175
  prop.type = type;
221
176
  };
222
177
  }
223
-
224
178
  var Spine = function (_super) {
225
179
  __extends(Spine, _super);
226
-
227
180
  function Spine() {
228
181
  var _this = _super !== null && _super.apply(this, arguments) || this;
229
-
230
182
  _this.resource = '';
183
+ _this.scale = 1;
231
184
  _this.animationName = '';
232
185
  _this.autoPlay = true;
233
186
  _this.waitExecuteInfos = [];
234
187
  return _this;
235
188
  }
236
-
237
189
  Object.defineProperty(Spine.prototype, "armature", {
238
- get: function get() {
190
+ get: function () {
239
191
  return this._armature;
240
192
  },
241
- set: function set(val) {
193
+ set: function (val) {
242
194
  var e_1, _a;
243
-
244
195
  this._armature = val;
245
196
  if (!val) return;
246
-
247
197
  if (this.autoPlay) {
248
198
  this.play(this.animationName);
249
199
  }
250
-
251
200
  try {
252
201
  for (var _b = __values(this.waitExecuteInfos), _c = _b.next(); !_c.done; _c = _b.next()) {
253
202
  var info = _c.value;
254
-
255
203
  if (info.playType) {
256
204
  var name_1 = info.name,
257
- loop = info.loop,
258
- track = info.track;
205
+ loop = info.loop,
206
+ track = info.track;
259
207
  this.play(name_1, loop, track);
260
208
  } else {
261
209
  this.stop(info.track);
@@ -272,27 +220,21 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
272
220
  if (e_1) throw e_1.error;
273
221
  }
274
222
  }
275
-
276
223
  this.waitExecuteInfos = [];
277
224
  },
278
225
  enumerable: false,
279
226
  configurable: true
280
227
  });
281
-
282
228
  Spine.prototype.init = function (obj) {
283
229
  if (!obj) return;
284
-
285
230
  _extends(this, obj);
286
231
  };
287
-
288
232
  Spine.prototype.onDestroy = function () {
289
233
  this.destroied = true;
290
234
  };
291
-
292
235
  Spine.prototype.play = function (name, loop, track) {
293
236
  try {
294
237
  if (name) this.animationName = name;
295
-
296
238
  if (!this.armature) {
297
239
  this.waitExecuteInfos.push({
298
240
  playType: true,
@@ -304,14 +246,12 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
304
246
  if (track === undefined) {
305
247
  track = 0;
306
248
  }
307
-
308
249
  this.armature.state.setAnimation(track, this.animationName, loop);
309
250
  }
310
251
  } catch (e) {
311
252
  console.log(e);
312
253
  }
313
254
  };
314
-
315
255
  Spine.prototype.stop = function (track) {
316
256
  if (!this.armature) {
317
257
  this.waitExecuteInfos.push({
@@ -320,39 +260,32 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
320
260
  });
321
261
  return;
322
262
  }
323
-
324
263
  if (track === undefined) {
325
264
  track = 0;
326
265
  }
327
-
328
266
  this.armature.state.setEmptyAnimation(track, 0);
329
267
  };
330
-
331
268
  Spine.prototype.addAnimation = function (name, delay, loop, track) {
332
269
  try {
333
270
  if (!this.armature) {} else {
334
271
  if (track === undefined) {
335
272
  track = 0;
336
273
  }
337
-
338
274
  this.armature.state.addAnimation(track, name, loop, delay);
339
275
  }
340
276
  } catch (e) {
341
277
  console.log(e);
342
278
  }
343
279
  };
344
-
345
280
  Spine.prototype.setMix = function (from, to, duration) {
346
281
  if (!this.armature) ;else {
347
282
  this.armature.stateData.setMix(from, to, duration);
348
283
  }
349
284
  };
350
-
351
285
  Spine.prototype.getAnim = function (track) {
352
286
  if (track === void 0) {
353
287
  track = 0;
354
288
  }
355
-
356
289
  try {
357
290
  if (!this.armature) {} else {
358
291
  return this.armature.state.tracks[track].animation.name;
@@ -361,173 +294,119 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
361
294
  console.log(e);
362
295
  }
363
296
  };
364
-
365
297
  Spine.prototype.setDefaultMix = function (duration) {
366
298
  if (!this.armature) ;else {
367
299
  this.armature.stateData.defaultMix = duration;
368
300
  }
369
301
  };
370
-
371
302
  Spine.prototype.setAttachment = function (slotName, attachmentName) {
372
303
  if (!this.armature) {
373
304
  return;
374
305
  }
375
-
376
306
  this.armature.skeleton.setAttachment(slotName, attachmentName);
377
307
  };
378
-
379
308
  Spine.prototype.getBone = function (boneName) {
380
309
  if (!this.armature) {
381
310
  return;
382
311
  }
383
-
384
312
  return this.armature.skeleton.findBone(boneName);
385
313
  };
386
-
387
314
  Spine.componentName = 'Spine';
388
-
389
315
  __decorate([type('string')], Spine.prototype, "resource", void 0);
390
-
316
+ __decorate([type('number')], Spine.prototype, "scale", void 0);
391
317
  __decorate([type('string')], Spine.prototype, "animationName", void 0);
392
-
393
318
  __decorate([type('boolean')], Spine.prototype, "autoPlay", void 0);
394
-
395
319
  return Spine;
396
320
  }(eva_js.Component);
397
-
398
321
  var Spine$1 = Spine;
399
322
  var texCache = {};
400
-
401
323
  function cacheImage(data) {
402
324
  var oldImg = data.image;
403
325
  return {
404
- tex: pixi_js.Texture.from(oldImg),
326
+ tex: oldImg instanceof pixi_js.Texture ? oldImg : pixi_js.Texture.from(oldImg),
405
327
  count: 0
406
328
  };
407
329
  }
408
-
409
330
  function retainTexture(name, data) {
410
331
  var cache = texCache[name];
411
-
412
332
  if (!cache) {
413
333
  cache = cacheImage(data);
414
334
  texCache[name] = cache;
415
335
  }
416
-
417
336
  cache.count++;
418
337
  return cache.tex;
419
338
  }
420
-
421
- function getTexture(imageSrc, data) {
422
- var cache = texCache[imageSrc];
423
-
424
- if (!cache) {
425
- cache = cacheImage(data);
426
- texCache[imageSrc] = cache;
427
- }
428
-
429
- return cache.tex;
430
- }
431
-
432
339
  function releaseTexture(imageSrc) {
433
340
  if (!imageSrc) return;
434
341
  setTimeout(function () {
435
342
  var cache = texCache[imageSrc];
436
-
437
343
  if (cache) {
438
344
  cache.count--;
439
-
440
345
  if (cache.count <= 0) {
441
346
  if (cache.tex) {
442
347
  cache.tex.destroy(true);
443
348
  cache.tex = null;
444
349
  }
445
-
446
350
  delete texCache[imageSrc];
447
351
  }
448
352
  }
449
353
  }, 100);
450
354
  }
451
-
452
355
  var dataMap = {};
453
-
454
356
  function createSpineData(name, data, scale, pixiSpine) {
455
- var spineData = null;
456
- var img = getTexture(data.image.src, data);
457
- new pixiSpine.core.TextureAtlas(data.atlas, function (line, callback) {
458
- callback(img.baseTexture);
459
- }, function (spineAtlas) {
460
- if (spineAtlas) {
461
- var attachmentLoader = new pixiSpine.core.AtlasAttachmentLoader(spineAtlas);
462
- var spineJsonParser = new pixiSpine.core.SkeletonJson(attachmentLoader);
463
-
464
- if (scale) {
465
- spineJsonParser.scale = scale;
466
- }
467
-
468
- spineData = spineJsonParser.readSkeletonData(data.ske);
469
- }
470
- });
357
+ var skeletonAsset = data.ske;
358
+ var atlasAsset = data.atlas;
359
+ var attachmentLoader = new pixiSpine.AtlasAttachmentLoader(atlasAsset);
360
+ var parser = skeletonAsset instanceof Uint8Array ? new pixiSpine.SkeletonBinary(attachmentLoader) : new pixiSpine.SkeletonJson(attachmentLoader);
361
+ parser.scale = scale || 1;
362
+ var skeletonData = parser.readSkeletonData(skeletonAsset);
471
363
  var obj = {
472
- spineData: spineData,
364
+ spineData: skeletonData,
473
365
  ref: 0,
474
- imageSrc: data.image.src
366
+ imageSrc: data.image.label
475
367
  };
476
368
  dataMap[name] = obj;
477
369
  return obj;
478
370
  }
479
-
480
- function getSpineData(res, pixiSpine) {
371
+ function getSpineData(res, scale, pixiSpine) {
481
372
  return __awaiter(this, void 0, void 0, function () {
482
373
  var data;
483
374
  return __generator(this, function (_a) {
484
375
  data = dataMap[res.name];
485
-
486
376
  if (!data) {
487
377
  if (res.complete) {
488
- data = createSpineData(res.name, res.data, res.scale, pixiSpine);
378
+ data = createSpineData(res.name, res.data, scale, pixiSpine);
489
379
  } else if (!data) {
490
380
  return [2];
491
381
  }
492
382
  }
493
-
494
- retainTexture(res.data.image.src, res.data);
383
+ retainTexture(res.data.image.label, res.data);
495
384
  data.ref++;
496
385
  return [2, data.spineData];
497
386
  });
498
387
  });
499
388
  }
500
-
501
389
  function releaseSpineData(resourceName, imageSrc) {
502
390
  var data = dataMap[resourceName];
503
-
504
391
  if (!data) {
505
392
  return;
506
393
  }
507
-
508
394
  data.ref--;
509
-
510
395
  if (data.ref <= 0) {
511
396
  releaseTexture(imageSrc);
512
397
  delete dataMap[resourceName];
513
398
  }
514
399
  }
515
-
516
400
  var MaxRetryCount = 20;
517
-
518
401
  var SpineSystem = function (_super) {
519
402
  __extends(SpineSystem, _super);
520
-
521
403
  function SpineSystem() {
522
404
  var _this = _super !== null && _super.apply(this, arguments) || this;
523
-
524
405
  _this.armatures = {};
525
406
  return _this;
526
407
  }
527
-
528
408
  SpineSystem.prototype.init = function (_a) {
529
409
  var _this = this;
530
-
531
410
  var pixiSpine = _a.pixiSpine;
532
411
  this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
533
412
  this.renderSystem.rendererManager.register(this);
@@ -535,16 +414,12 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
535
414
  this.game.canvas.addEventListener('webglcontextrestored', function () {
536
415
  var objs = _this.game.gameObjects;
537
416
  var toAdd = [];
538
-
539
417
  for (var k in _this.armatures) {
540
418
  var id = +k;
541
-
542
419
  for (var i = 0; i < objs.length; ++i) {
543
420
  var obj = objs[i];
544
-
545
421
  if (obj.id === id) {
546
422
  var sp = obj.getComponent(Spine$1);
547
-
548
423
  if (sp) {
549
424
  _this.remove({
550
425
  type: eva_js.OBSERVER_TYPE.REMOVE,
@@ -552,7 +427,6 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
552
427
  component: sp,
553
428
  componentName: Spine$1.componentName
554
429
  });
555
-
556
430
  toAdd.push({
557
431
  type: eva_js.OBSERVER_TYPE.ADD,
558
432
  gameObject: obj,
@@ -560,12 +434,10 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
560
434
  componentName: Spine$1.componentName
561
435
  });
562
436
  }
563
-
564
437
  break;
565
438
  }
566
439
  }
567
440
  }
568
-
569
441
  setTimeout(function () {
570
442
  toAdd.forEach(function (obj) {
571
443
  _this.add(obj);
@@ -573,16 +445,12 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
573
445
  }, 1000);
574
446
  }, false);
575
447
  };
576
-
577
448
  SpineSystem.prototype.update = function (e) {
578
449
  for (var key in this.armatures) {
579
450
  this.armatures[key].update(e.deltaTime * 0.001);
580
- this.armatures[key].updateTransform();
581
451
  }
582
-
583
452
  _super.prototype.update.call(this);
584
453
  };
585
-
586
454
  SpineSystem.prototype.componentChanged = function (changed) {
587
455
  return __awaiter(this, void 0, void 0, function () {
588
456
  return __generator(this, function (_a) {
@@ -599,20 +467,15 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
599
467
  this.remove(changed);
600
468
  }
601
469
  }
602
-
603
470
  return [2];
604
471
  });
605
472
  });
606
473
  };
607
-
608
474
  SpineSystem.prototype.add = function (changed, count) {
609
475
  var _a, _b;
610
-
611
476
  return __awaiter(this, void 0, void 0, function () {
612
477
  var component, gameObjectId, asyncId, res, spineData, container, armature, tran;
613
-
614
478
  var _this = this;
615
-
616
479
  return __generator(this, function (_c) {
617
480
  switch (_c.label) {
618
481
  case 0:
@@ -621,25 +484,20 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
621
484
  gameObjectId = changed.gameObject.id;
622
485
  asyncId = this.increaseAsyncId(gameObjectId);
623
486
  return [4, eva_js.resource.getResource(component.resource)];
624
-
625
487
  case 1:
626
488
  res = _c.sent();
627
489
  if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
628
- return [4, getSpineData(res, this.pixiSpine)];
629
-
490
+ return [4, getSpineData(res, component.scale, this.pixiSpine)];
630
491
  case 2:
631
492
  spineData = _c.sent();
632
493
  if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
633
-
634
494
  if (!spineData) {
635
495
  component.addHandler = setTimeout(function () {
636
496
  if (!component.destroied) {
637
497
  if (count === undefined) {
638
498
  count = MaxRetryCount;
639
499
  }
640
-
641
500
  count--;
642
-
643
501
  if (count > 0) {
644
502
  _this.add(changed, count);
645
503
  } else {
@@ -649,58 +507,55 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
649
507
  }, 1000);
650
508
  return [2];
651
509
  }
652
-
653
510
  this.remove(changed);
654
511
  container = (_b = (_a = this.renderSystem) === null || _a === void 0 ? void 0 : _a.containerManager) === null || _b === void 0 ? void 0 : _b.getContainer(changed.gameObject.id);
655
-
656
512
  if (!container) {
657
513
  return [2];
658
514
  }
659
-
660
515
  component.lastResource = component.resource;
661
- armature = new this.pixiSpine.Spine(spineData);
516
+ armature = new this.pixiSpine.Spine({
517
+ skeletonData: spineData,
518
+ autoUpdate: false
519
+ });
662
520
  this.armatures[changed.gameObject.id] = armature;
663
-
664
521
  if (changed.gameObject && changed.gameObject.transform) {
665
522
  tran = changed.gameObject.transform;
666
523
  armature.x = tran.size.width * tran.origin.x;
667
524
  armature.y = tran.size.height * tran.origin.y;
668
525
  }
669
-
670
526
  container.addChildAt(armature, 0);
671
527
  armature.update();
672
- armature.updateTransform();
673
528
  component.armature = armature;
674
529
  component.emit('loaded', {
675
530
  resource: component.resource
676
531
  });
677
532
  armature.state.addListener({
678
- start: function start(track, event) {
533
+ start: function (track, event) {
679
534
  component.emit('start', {
680
535
  track: track,
681
536
  name: track.animation.name
682
537
  });
683
538
  },
684
- complete: function complete(track, event) {
539
+ complete: function (track, event) {
685
540
  component.emit('complete', {
686
541
  track: track,
687
542
  name: track.animation.name
688
543
  });
689
544
  },
690
- interrupt: function interrupt(track, event) {
545
+ interrupt: function (track, event) {
691
546
  component.emit('interrupt', {
692
547
  track: track,
693
548
  name: track.animation.name
694
549
  });
695
550
  },
696
- end: function end(track, event) {
551
+ end: function (track, event) {
697
552
  component.emit('end', {
698
553
  track: track,
699
554
  name: track.animation.name
700
555
  });
701
556
  },
702
- event: function event(track, _event) {
703
- component.emit('event', track, _event);
557
+ event: function (track, event) {
558
+ component.emit('event', track, event);
704
559
  }
705
560
  });
706
561
  return [2];
@@ -708,15 +563,12 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
708
563
  });
709
564
  });
710
565
  };
711
-
712
566
  SpineSystem.prototype.change = function (changed) {
713
567
  this.remove(changed);
714
568
  this.add(changed);
715
569
  };
716
-
717
570
  SpineSystem.prototype.remove = function (changed) {
718
571
  var _a, _b, _c, _d;
719
-
720
572
  return __awaiter(this, void 0, void 0, function () {
721
573
  var component, armature, container, res;
722
574
  return __generator(this, function (_e) {
@@ -727,22 +579,18 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
727
579
  clearTimeout(component.addHandler);
728
580
  armature = this.armatures[changed.gameObject.id];
729
581
  container = (_b = (_a = this.renderSystem) === null || _a === void 0 ? void 0 : _a.containerManager) === null || _b === void 0 ? void 0 : _b.getContainer(changed.gameObject.id);
730
-
731
582
  if (container && armature) {
732
583
  container.removeChild(armature);
733
584
  }
734
-
735
585
  if (!component.armature) return [3, 2];
736
586
  component.armature.destroy({
737
587
  children: true
738
588
  });
739
589
  return [4, eva_js.resource.getResource(component.lastResource)];
740
-
741
590
  case 1:
742
591
  res = _e.sent();
743
592
  releaseSpineData(res.name, (_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.image) === null || _d === void 0 ? void 0 : _d.src);
744
593
  _e.label = 2;
745
-
746
594
  case 2:
747
595
  component.armature = null;
748
596
  delete this.armatures[changed.gameObject.id];
@@ -752,14 +600,12 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
752
600
  });
753
601
  });
754
602
  };
755
-
756
603
  SpineSystem.systemName = 'SpineSystem';
757
604
  SpineSystem = __decorate([eva_js.decorators.componentObserver({
758
605
  Spine: ['resource']
759
606
  })], SpineSystem);
760
607
  return SpineSystem;
761
608
  }(pluginRenderer.Renderer);
762
-
763
609
  var SpineSystem$1 = SpineSystem;
764
610
  eva_js.resource.registerResourceType('SPINE');
765
611
  exports.Spine = Spine$1;
@@ -769,5 +615,4 @@ var _EVA_IIFE_spineBase = function (exports, eva_js, pluginRenderer, pixi_js) {
769
615
  });
770
616
  return exports;
771
617
  }({}, EVA, EVA.plugin.renderer, PIXI);
772
-
773
618
  window.EVA.plugin.spineBase = window.EVA.plugin.spineBase || _EVA_IIFE_spineBase;