@eva/plugin-renderer-sprite-animation 1.1.1-fix.1 → 1.1.1-fix.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.
- package/dist/EVA.plugin.renderer.spriteAnimation.js +617 -0
- package/dist/EVA.plugin.renderer.spriteAnimation.min.js +2 -0
- package/dist/EVA.plugin.renderer.spriteAnimation.min.js.map +1 -0
- package/dist/plugin-renderer-sprite-animation.cjs.js +50 -6
- package/dist/plugin-renderer-sprite-animation.cjs.prod.js +2 -1
- package/dist/plugin-renderer-sprite-animation.cjs.prod.js.map +1 -0
- package/dist/plugin-renderer-sprite-animation.d.ts +63 -0
- package/dist/plugin-renderer-sprite-animation.esm.js +51 -7
- package/package.json +4 -4
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
window.EVA = window.EVA || {};
|
|
4
|
+
window.EVA.plugin = window.EVA.plugin || {};
|
|
5
|
+
window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
|
|
6
|
+
|
|
7
|
+
var _EVA_IIFE_spriteAnimation = function (exports, eva_js, pluginRenderer, rendererAdapter, pixi_js) {
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
var _extendStatics = function extendStatics(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 (b.hasOwnProperty(p)) d[p] = b[p];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return _extendStatics(d, b);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function __extends(d, b) {
|
|
25
|
+
_extendStatics(d, b);
|
|
26
|
+
|
|
27
|
+
function __() {
|
|
28
|
+
this.constructor = d;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function __decorate(decorators, target, key, desc) {
|
|
35
|
+
var c = arguments.length,
|
|
36
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
37
|
+
d;
|
|
38
|
+
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--) {
|
|
39
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
+
}
|
|
41
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
45
|
+
function adopt(value) {
|
|
46
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
47
|
+
resolve(value);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
52
|
+
function fulfilled(value) {
|
|
53
|
+
try {
|
|
54
|
+
step(generator.next(value));
|
|
55
|
+
} catch (e) {
|
|
56
|
+
reject(e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function rejected(value) {
|
|
61
|
+
try {
|
|
62
|
+
step(generator["throw"](value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function step(result) {
|
|
69
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function __generator(thisArg, body) {
|
|
77
|
+
var _ = {
|
|
78
|
+
label: 0,
|
|
79
|
+
sent: function sent() {
|
|
80
|
+
if (t[0] & 1) throw t[1];
|
|
81
|
+
return t[1];
|
|
82
|
+
},
|
|
83
|
+
trys: [],
|
|
84
|
+
ops: []
|
|
85
|
+
},
|
|
86
|
+
f,
|
|
87
|
+
y,
|
|
88
|
+
t,
|
|
89
|
+
g;
|
|
90
|
+
return g = {
|
|
91
|
+
next: verb(0),
|
|
92
|
+
"throw": verb(1),
|
|
93
|
+
"return": verb(2)
|
|
94
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
95
|
+
return this;
|
|
96
|
+
}), g;
|
|
97
|
+
|
|
98
|
+
function verb(n) {
|
|
99
|
+
return function (v) {
|
|
100
|
+
return step([n, v]);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function step(op) {
|
|
105
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
106
|
+
|
|
107
|
+
while (_) {
|
|
108
|
+
try {
|
|
109
|
+
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;
|
|
110
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
111
|
+
|
|
112
|
+
switch (op[0]) {
|
|
113
|
+
case 0:
|
|
114
|
+
case 1:
|
|
115
|
+
t = op;
|
|
116
|
+
break;
|
|
117
|
+
|
|
118
|
+
case 4:
|
|
119
|
+
_.label++;
|
|
120
|
+
return {
|
|
121
|
+
value: op[1],
|
|
122
|
+
done: false
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
case 5:
|
|
126
|
+
_.label++;
|
|
127
|
+
y = op[1];
|
|
128
|
+
op = [0];
|
|
129
|
+
continue;
|
|
130
|
+
|
|
131
|
+
case 7:
|
|
132
|
+
op = _.ops.pop();
|
|
133
|
+
|
|
134
|
+
_.trys.pop();
|
|
135
|
+
|
|
136
|
+
continue;
|
|
137
|
+
|
|
138
|
+
default:
|
|
139
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
140
|
+
_ = 0;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
145
|
+
_.label = op[1];
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
150
|
+
_.label = t[1];
|
|
151
|
+
t = op;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (t && _.label < t[2]) {
|
|
156
|
+
_.label = t[2];
|
|
157
|
+
|
|
158
|
+
_.ops.push(op);
|
|
159
|
+
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (t[2]) _.ops.pop();
|
|
164
|
+
|
|
165
|
+
_.trys.pop();
|
|
166
|
+
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
op = body.call(thisArg, _);
|
|
171
|
+
} catch (e) {
|
|
172
|
+
op = [6, e];
|
|
173
|
+
y = 0;
|
|
174
|
+
} finally {
|
|
175
|
+
f = t = 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (op[0] & 5) throw op[1];
|
|
180
|
+
return {
|
|
181
|
+
value: op[0] ? op[1] : void 0,
|
|
182
|
+
done: true
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function __values(o) {
|
|
188
|
+
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
189
|
+
m = s && o[s],
|
|
190
|
+
i = 0;
|
|
191
|
+
if (m) return m.call(o);
|
|
192
|
+
if (o && typeof o.length === "number") return {
|
|
193
|
+
next: function next() {
|
|
194
|
+
if (o && i >= o.length) o = void 0;
|
|
195
|
+
return {
|
|
196
|
+
value: o && o[i++],
|
|
197
|
+
done: !o
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
};
|
|
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
|
+
}
|
|
224
|
+
|
|
225
|
+
function step(step) {
|
|
226
|
+
return function (target, propertyKey) {
|
|
227
|
+
var prop = getIDEPropsPropertyObj(target, propertyKey);
|
|
228
|
+
prop.step = step;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
var SpriteAnimation$2 = function (_super) {
|
|
233
|
+
__extends(SpriteAnimation, _super);
|
|
234
|
+
|
|
235
|
+
function SpriteAnimation() {
|
|
236
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
237
|
+
|
|
238
|
+
_this.resource = '';
|
|
239
|
+
_this.autoPlay = true;
|
|
240
|
+
_this.speed = 100;
|
|
241
|
+
_this.forwards = false;
|
|
242
|
+
_this.waitPlay = false;
|
|
243
|
+
_this.waitStop = false;
|
|
244
|
+
_this.times = Infinity;
|
|
245
|
+
_this.count = 0;
|
|
246
|
+
_this.complete = false;
|
|
247
|
+
return _this;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
SpriteAnimation.prototype.init = function (obj) {
|
|
251
|
+
var _this = this;
|
|
252
|
+
|
|
253
|
+
obj && _extends(this, obj);
|
|
254
|
+
this.on('loop', function () {
|
|
255
|
+
if (++_this.count >= _this.times) {
|
|
256
|
+
if (_this.forwards) {
|
|
257
|
+
_this.gotoAndStop(_this.totalFrames - 1);
|
|
258
|
+
} else {
|
|
259
|
+
_this.animate.stop();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
_this.complete = true;
|
|
263
|
+
|
|
264
|
+
_this.emit('complete');
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
SpriteAnimation.prototype.play = function (times) {
|
|
270
|
+
if (times === void 0) {
|
|
271
|
+
times = Infinity;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (times === 0) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
this.times = times;
|
|
279
|
+
|
|
280
|
+
if (!this.animate) {
|
|
281
|
+
this.waitPlay = true;
|
|
282
|
+
} else {
|
|
283
|
+
if (this.complete) {
|
|
284
|
+
this.gotoAndStop(0);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
this.animate.play();
|
|
288
|
+
this.count = 0;
|
|
289
|
+
this.complete = false;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
SpriteAnimation.prototype.stop = function () {
|
|
294
|
+
if (!this.animate) {
|
|
295
|
+
this.waitStop = true;
|
|
296
|
+
} else {
|
|
297
|
+
this.animate.stop();
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
Object.defineProperty(SpriteAnimation.prototype, "animate", {
|
|
302
|
+
get: function get() {
|
|
303
|
+
return this._animate;
|
|
304
|
+
},
|
|
305
|
+
set: function set(val) {
|
|
306
|
+
this._animate = val;
|
|
307
|
+
|
|
308
|
+
if (this.waitPlay) {
|
|
309
|
+
this.waitPlay = false;
|
|
310
|
+
this.play(this.times);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (this.waitStop) {
|
|
314
|
+
this.waitStop = false;
|
|
315
|
+
this.stop();
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
enumerable: false,
|
|
319
|
+
configurable: true
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
SpriteAnimation.prototype.gotoAndPlay = function (frameNumber) {
|
|
323
|
+
this.animate.gotoAndPlay(frameNumber);
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
|
|
327
|
+
this.animate.gotoAndStop(frameNumber);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
Object.defineProperty(SpriteAnimation.prototype, "currentFrame", {
|
|
331
|
+
get: function get() {
|
|
332
|
+
var _a, _b;
|
|
333
|
+
|
|
334
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.currentFrame;
|
|
335
|
+
},
|
|
336
|
+
enumerable: false,
|
|
337
|
+
configurable: true
|
|
338
|
+
});
|
|
339
|
+
Object.defineProperty(SpriteAnimation.prototype, "totalFrames", {
|
|
340
|
+
get: function get() {
|
|
341
|
+
var _a, _b;
|
|
342
|
+
|
|
343
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.totalFrames;
|
|
344
|
+
},
|
|
345
|
+
enumerable: false,
|
|
346
|
+
configurable: true
|
|
347
|
+
});
|
|
348
|
+
SpriteAnimation.componentName = 'SpriteAnimation';
|
|
349
|
+
|
|
350
|
+
__decorate([type('string')], SpriteAnimation.prototype, "resource", void 0);
|
|
351
|
+
|
|
352
|
+
__decorate([type('boolean')], SpriteAnimation.prototype, "autoPlay", void 0);
|
|
353
|
+
|
|
354
|
+
__decorate([type('number'), step(10)], SpriteAnimation.prototype, "speed", void 0);
|
|
355
|
+
|
|
356
|
+
__decorate([type('boolean')], SpriteAnimation.prototype, "forwards", void 0);
|
|
357
|
+
|
|
358
|
+
return SpriteAnimation;
|
|
359
|
+
}(eva_js.Component);
|
|
360
|
+
|
|
361
|
+
var SpriteAnimation$3 = SpriteAnimation$2;
|
|
362
|
+
var resourceKeySplit = '_s|r|c_';
|
|
363
|
+
eva_js.resource.registerInstance(eva_js.RESOURCE_TYPE.SPRITE_ANIMATION, function (_a) {
|
|
364
|
+
var name = _a.name,
|
|
365
|
+
data = _a.data;
|
|
366
|
+
return new Promise(function (r) {
|
|
367
|
+
var e_1, _a;
|
|
368
|
+
|
|
369
|
+
var textureObj = data.json;
|
|
370
|
+
var texture = pixi_js.BaseTexture.from(data.image);
|
|
371
|
+
var frames = textureObj.frames || {};
|
|
372
|
+
var animations = textureObj.animations || {};
|
|
373
|
+
var newFrames = {};
|
|
374
|
+
|
|
375
|
+
for (var key in frames) {
|
|
376
|
+
var newKey = name + resourceKeySplit + key;
|
|
377
|
+
newFrames[newKey] = frames[key];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
for (var key in animations) {
|
|
381
|
+
var spriteList = [];
|
|
382
|
+
|
|
383
|
+
if (animations[key] && animations[key].length >= 0) {
|
|
384
|
+
try {
|
|
385
|
+
for (var _b = (e_1 = void 0, __values(animations[key])), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
386
|
+
var spriteName = _c.value;
|
|
387
|
+
var newSpriteName = name + resourceKeySplit + spriteName;
|
|
388
|
+
spriteList.push(newSpriteName);
|
|
389
|
+
}
|
|
390
|
+
} catch (e_1_1) {
|
|
391
|
+
e_1 = {
|
|
392
|
+
error: e_1_1
|
|
393
|
+
};
|
|
394
|
+
} finally {
|
|
395
|
+
try {
|
|
396
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
397
|
+
} finally {
|
|
398
|
+
if (e_1) throw e_1.error;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
animations[key] = spriteList;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
textureObj.frames = newFrames;
|
|
407
|
+
var spriteSheet = new pixi_js.Spritesheet(texture, textureObj);
|
|
408
|
+
spriteSheet.parse(function () {
|
|
409
|
+
var textures = spriteSheet.textures;
|
|
410
|
+
var spriteFrames = [];
|
|
411
|
+
|
|
412
|
+
for (var key in textures) {
|
|
413
|
+
spriteFrames.push(textures[key]);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
r(spriteFrames);
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
eva_js.resource.registerDestroy(eva_js.RESOURCE_TYPE.SPRITE_ANIMATION, function (_a) {
|
|
421
|
+
var e_2, _b;
|
|
422
|
+
|
|
423
|
+
var instance = _a.instance;
|
|
424
|
+
if (!instance) return;
|
|
425
|
+
|
|
426
|
+
try {
|
|
427
|
+
for (var instance_1 = __values(instance), instance_1_1 = instance_1.next(); !instance_1_1.done; instance_1_1 = instance_1.next()) {
|
|
428
|
+
var texture = instance_1_1.value;
|
|
429
|
+
texture.destroy(true);
|
|
430
|
+
}
|
|
431
|
+
} catch (e_2_1) {
|
|
432
|
+
e_2 = {
|
|
433
|
+
error: e_2_1
|
|
434
|
+
};
|
|
435
|
+
} finally {
|
|
436
|
+
try {
|
|
437
|
+
if (instance_1_1 && !instance_1_1.done && (_b = instance_1.return)) _b.call(instance_1);
|
|
438
|
+
} finally {
|
|
439
|
+
if (e_2) throw e_2.error;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
var SpriteAnimation = function (_super) {
|
|
445
|
+
__extends(SpriteAnimation, _super);
|
|
446
|
+
|
|
447
|
+
function SpriteAnimation() {
|
|
448
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
449
|
+
|
|
450
|
+
_this.name = 'SpriteAnimation';
|
|
451
|
+
_this.animates = {};
|
|
452
|
+
_this.autoPlay = {};
|
|
453
|
+
return _this;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
SpriteAnimation.prototype.init = function () {
|
|
457
|
+
this.renderSystem = this.game.getSystem(pluginRenderer.RendererSystem);
|
|
458
|
+
this.renderSystem.rendererManager.register(this);
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
SpriteAnimation.prototype.rendererUpdate = function (gameObject) {
|
|
462
|
+
var _a = gameObject.transform.size,
|
|
463
|
+
width = _a.width,
|
|
464
|
+
height = _a.height;
|
|
465
|
+
|
|
466
|
+
if (this.animates[gameObject.id]) {
|
|
467
|
+
this.animates[gameObject.id].animatedSprite.width = width;
|
|
468
|
+
this.animates[gameObject.id].animatedSprite.height = height;
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
SpriteAnimation.prototype.componentChanged = function (changed) {
|
|
473
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
474
|
+
var gameObjectId, component, asyncId, frames_1, asyncId, frames_2;
|
|
475
|
+
return __generator(this, function (_a) {
|
|
476
|
+
switch (_a.label) {
|
|
477
|
+
case 0:
|
|
478
|
+
gameObjectId = changed.gameObject.id;
|
|
479
|
+
if (!(changed.componentName === 'SpriteAnimation')) return [3, 7];
|
|
480
|
+
component = changed.component;
|
|
481
|
+
this.autoPlay[changed.gameObject.id] = component.autoPlay;
|
|
482
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3, 2];
|
|
483
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
484
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
485
|
+
|
|
486
|
+
case 1:
|
|
487
|
+
frames_1 = _a.sent().instance;
|
|
488
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
|
|
489
|
+
|
|
490
|
+
if (!frames_1) {
|
|
491
|
+
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
this.add({
|
|
495
|
+
frames: frames_1,
|
|
496
|
+
id: changed.gameObject.id,
|
|
497
|
+
component: component
|
|
498
|
+
});
|
|
499
|
+
return [3, 7];
|
|
500
|
+
|
|
501
|
+
case 2:
|
|
502
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.CHANGE)) return [3, 6];
|
|
503
|
+
if (!(changed.prop && changed.prop.prop[0] === 'speed')) return [3, 3];
|
|
504
|
+
this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;
|
|
505
|
+
return [3, 5];
|
|
506
|
+
|
|
507
|
+
case 3:
|
|
508
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
509
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
510
|
+
|
|
511
|
+
case 4:
|
|
512
|
+
frames_2 = _a.sent().instance;
|
|
513
|
+
if (!this.validateAsyncId(gameObjectId, asyncId)) return [2];
|
|
514
|
+
|
|
515
|
+
if (!frames_2) {
|
|
516
|
+
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
this.change({
|
|
520
|
+
frames: frames_2,
|
|
521
|
+
id: changed.gameObject.id,
|
|
522
|
+
component: component
|
|
523
|
+
});
|
|
524
|
+
_a.label = 5;
|
|
525
|
+
|
|
526
|
+
case 5:
|
|
527
|
+
return [3, 7];
|
|
528
|
+
|
|
529
|
+
case 6:
|
|
530
|
+
if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
531
|
+
this.increaseAsyncId(gameObjectId);
|
|
532
|
+
this.remove(changed.gameObject.id);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
_a.label = 7;
|
|
536
|
+
|
|
537
|
+
case 7:
|
|
538
|
+
return [2];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
SpriteAnimation.prototype.add = function (_a) {
|
|
545
|
+
var frames = _a.frames,
|
|
546
|
+
id = _a.id,
|
|
547
|
+
component = _a.component;
|
|
548
|
+
var animate = new rendererAdapter.SpriteAnimation({
|
|
549
|
+
frames: frames
|
|
550
|
+
});
|
|
551
|
+
this.animates[id] = animate;
|
|
552
|
+
this.containerManager.getContainer(id).addChildAt(animate.animatedSprite, 0);
|
|
553
|
+
|
|
554
|
+
animate.animatedSprite.onComplete = function () {
|
|
555
|
+
component.emit('complete');
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
animate.animatedSprite.onFrameChange = function () {
|
|
559
|
+
component.emit('frameChange');
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
animate.animatedSprite.onLoop = function () {
|
|
563
|
+
component.emit('loop');
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
component.animate = this.animates[id];
|
|
567
|
+
this.animates[id].speed = 1000 / 60 / component.speed;
|
|
568
|
+
|
|
569
|
+
if (this.autoPlay[id]) {
|
|
570
|
+
animate.animatedSprite.play();
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
SpriteAnimation.prototype.change = function (_a) {
|
|
575
|
+
var frames = _a.frames,
|
|
576
|
+
id = _a.id,
|
|
577
|
+
component = _a.component;
|
|
578
|
+
this.remove(id, true);
|
|
579
|
+
this.add({
|
|
580
|
+
frames: frames,
|
|
581
|
+
id: id,
|
|
582
|
+
component: component
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
SpriteAnimation.prototype.remove = function (id, isChange) {
|
|
587
|
+
var animate = this.animates[id];
|
|
588
|
+
if (!animate) return;
|
|
589
|
+
this.autoPlay[id] = animate.animatedSprite.playing;
|
|
590
|
+
this.containerManager.getContainer(id).removeChild(animate.animatedSprite);
|
|
591
|
+
animate.animatedSprite.destroy({
|
|
592
|
+
children: true
|
|
593
|
+
});
|
|
594
|
+
delete this.animates[id];
|
|
595
|
+
|
|
596
|
+
if (!isChange) {
|
|
597
|
+
delete this.autoPlay[id];
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
SpriteAnimation.systemName = 'SpriteAnimation';
|
|
602
|
+
SpriteAnimation = __decorate([eva_js.decorators.componentObserver({
|
|
603
|
+
SpriteAnimation: ['speed', 'resource']
|
|
604
|
+
})], SpriteAnimation);
|
|
605
|
+
return SpriteAnimation;
|
|
606
|
+
}(pluginRenderer.Renderer);
|
|
607
|
+
|
|
608
|
+
var SpriteAnimation$1 = SpriteAnimation;
|
|
609
|
+
exports.SpriteAnimation = SpriteAnimation$3;
|
|
610
|
+
exports.SpriteAnimationSystem = SpriteAnimation$1;
|
|
611
|
+
Object.defineProperty(exports, '__esModule', {
|
|
612
|
+
value: true
|
|
613
|
+
});
|
|
614
|
+
return exports;
|
|
615
|
+
}({}, EVA, EVA.plugin.renderer, EVA.rendererAdapter, PIXI);
|
|
616
|
+
|
|
617
|
+
window.EVA.plugin.renderer.spriteAnimation = window.EVA.plugin.renderer.spriteAnimation || _EVA_IIFE_spriteAnimation;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e,t;e=this,t=function(e,t,r,n,o){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function a(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function s(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function p(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{p(n.next(e))}catch(e){i(e)}}function s(e){try{p(n.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}p((n=n.apply(e,t||[])).next())}))}function c(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var l=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.autoPlay=!0,t.speed=100,t.waitPlay=!1,t.waitStop=!1,t.times=1/0,t.count=0,t}return a(r,e),r.prototype.init=function(e){var t=this;e&&Object.assign(this,e),this.on("loop",(function(){++t.count>=t.times&&(t.animate.stop(),t.emit("complete"))}))},r.prototype.play=function(e){void 0===e&&(e=1/0),0!==e&&(this.times=e,this.animate?(this.animate.play(),this.count=0):this.waitPlay=!0)},r.prototype.stop=function(){this.animate?this.animate.stop():this.waitStop=!0},Object.defineProperty(r.prototype,"animate",{get:function(){return this._animate},set:function(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())},enumerable:!1,configurable:!0}),r.prototype.gotoAndPlay=function(e){this.animate.gotoAndPlay(e)},r.prototype.gotoAndStop=function(e){this.animate.gotoAndStop(e)},r.componentName="SpriteAnimation",s([t.decorators.IDEProp],r.prototype,"resource",void 0),s([t.decorators.IDEProp],r.prototype,"autoPlay",void 0),s([t.decorators.IDEProp],r.prototype,"speed",void 0),r}(t.Component),f="_s|r|c_";t.resource.registerInstance(t.RESOURCE_TYPE.SPRITE_ANIMATION,(function(e){var t=e.name,r=e.data;return new Promise((function(e){var n,i,a=r.json,s=o.BaseTexture.from(r.image),p=a.frames||{},c=a.animations||{},l={};for(var d in p)l[t+f+d]=p[d];for(var d in c){var m=[];if(c[d]&&c[d].length>=0)try{for(var h=(n=void 0,u(c[d])),y=h.next();!y.done;y=h.next()){var v=y.value,g=t+f+v;m.push(g)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}c[d]=m}a.frames=l;var b=new o.Spritesheet(s,a);b.parse((function(){var t=b.textures,r=[];for(var n in t)r.push(t[n]);e(r)}))}))})),t.resource.registerDestroy(t.RESOURCE_TYPE.SPRITE_ANIMATION,(function(e){var t,r,n=e.instance;if(n)try{for(var o=u(n),i=o.next();!i.done;i=o.next())i.value.destroy(!0)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}));var d=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="SpriteAnimation",t.animates={},t.autoPlay={},t}return a(o,e),o.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},o.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=r,this.animates[e.id].animatedSprite.height=n)},o.prototype.componentChanged=function(e){return p(this,void 0,void 0,(function(){var r,n,o;return c(this,(function(i){switch(i.label){case 0:return"SpriteAnimation"!==e.componentName?[3,7]:(r=e.component,this.autoPlay[e.gameObject.id]=r.autoPlay,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:[4,t.resource.getResource(r.resource)]);case 1:return(n=i.sent().instance)||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.add({frames:n,id:e.gameObject.id,component:r}),[3,7];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,6]:e.prop&&"speed"===e.prop.prop[0]?(this.animates[e.gameObject.id].speed=1e3/60/r.speed,[3,5]):[3,3];case 3:return[4,t.resource.getResource(r.resource)];case 4:(o=i.sent().instance)||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.change({frames:o,id:e.gameObject.id,component:r}),i.label=5;case 5:return[3,7];case 6:e.type===t.OBSERVER_TYPE.REMOVE&&this.remove(e.gameObject.id),i.label=7;case 7:return[2]}}))}))},o.prototype.add=function(e){var t=e.frames,r=e.id,o=e.component,i=new n.SpriteAnimation({frames:t});this.animates[r]=i,this.containerManager.getContainer(r).addChildAt(i.animatedSprite,0),i.animatedSprite.onComplete=function(){o.emit("complete")},i.animatedSprite.onFrameChange=function(){o.emit("frameChange")},i.animatedSprite.onLoop=function(){o.emit("loop")},o.animate=this.animates[r],this.animates[r].speed=1e3/60/o.speed,this.autoPlay[r]&&i.animatedSprite.play()},o.prototype.change=function(e){var t=e.frames,r=e.id,n=e.component;this.remove(r,!0),this.add({frames:t,id:r,component:n})},o.prototype.remove=function(e,t){var r=this.animates[e];this.autoPlay[e]=r.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(r.animatedSprite),r.animatedSprite.destroy({children:!0}),delete this.animates[e],t||delete this.autoPlay[e]},o.systemName="SpriteAnimation",o=s([t.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],o)}(r.Renderer);e.SpriteAnimation=l,e.SpriteAnimationSystem=d,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@eva/eva.js"),require("@eva/plugin-renderer"),require("@eva/renderer-adapter"),require("pixi.js")):"function"==typeof define&&define.amd?define(["exports","@eva/eva.js","@eva/plugin-renderer","@eva/renderer-adapter","pixi.js"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).EVA=e.EVA||{},e.EVA.plugin=e.EVA.plugin||{},e.EVA.plugin.renderer=e.EVA.plugin.renderer||{},e.EVA.plugin.renderer.spriteAnimation={}),e.EVA,e.EVA.plugin.renderer,e.EVA.rendererAdapter,e.PIXI);
|
|
2
|
+
//# sourceMappingURL=EVA.plugin.renderer.spriteAnimation.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EVA.plugin.renderer.spriteAnimation.min.js","sources":["../../../node_modules/tslib/tslib.es6.js","../lib/component.ts","../lib/system.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n 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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n 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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { Component, decorators } from '@eva/eva.js';\nimport { SpriteAnimation as SpriteAnimationEngine } from '@eva/renderer-adapter';\n\nexport interface SpriteAnimationParams {\n resource: string;\n autoPlay: boolean;\n speed: number;\n}\n\nexport default class SpriteAnimation extends Component<SpriteAnimationParams> {\n static componentName: string = 'SpriteAnimation';\n @decorators.IDEProp resource: string = '';\n @decorators.IDEProp autoPlay: boolean = true;\n @decorators.IDEProp speed: number = 100;\n _animate: SpriteAnimationEngine;\n private waitPlay: boolean = false;\n private waitStop: boolean = false;\n private times: number = Infinity;\n private count: number = 0;\n init(obj?: SpriteAnimationParams) {\n obj && Object.assign(this, obj);\n this.on('loop', () => {\n if (++this.count >= this.times) {\n this.animate.stop();\n this.emit('complete');\n }\n });\n }\n play(times = Infinity) {\n if (times === 0) {\n return;\n }\n this.times = times;\n if (!this.animate) {\n this.waitPlay = true;\n } else {\n this.animate.play();\n this.count = 0;\n }\n }\n stop() {\n if (!this.animate) {\n this.waitStop = true;\n } else {\n this.animate.stop();\n }\n }\n set animate(val) {\n this._animate = val;\n if (this.waitPlay) {\n this.waitPlay = false;\n this.play(this.times);\n }\n if (this.waitStop) {\n this.waitStop = false;\n this.stop();\n }\n }\n get animate() {\n return this._animate;\n }\n gotoAndPlay(frameNumber) {\n this.animate.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber) {\n this.animate.gotoAndStop(frameNumber);\n }\n}\n","import { GameObject, decorators, resource, ComponentChanged, RESOURCE_TYPE, OBSERVER_TYPE } from '@eva/eva.js';\nimport { RendererManager, ContainerManager, RendererSystem, Renderer } from '@eva/plugin-renderer';\nimport { SpriteAnimation as SpriteAnimationEngine } from '@eva/renderer-adapter';\nimport { Spritesheet, BaseTexture } from 'pixi.js';\n\nimport SpriteAnimationComponent from './component';\n\nconst resourceKeySplit = '_s|r|c_';\n\nresource.registerInstance(RESOURCE_TYPE.SPRITE_ANIMATION, ({ name, data }) => {\n return new Promise(r => {\n const textureObj = data.json;\n const texture = BaseTexture.from(data.image);\n const frames = textureObj.frames || {};\n const animations = textureObj.animations || {};\n const newFrames = {};\n for (const key in frames) {\n const newKey = name + resourceKeySplit + key;\n newFrames[newKey] = frames[key];\n }\n for (const key in animations) {\n const spriteList = [];\n if (animations[key] && animations[key].length >= 0) {\n for (const spriteName of animations[key]) {\n const newSpriteName = name + resourceKeySplit + spriteName;\n spriteList.push(newSpriteName);\n }\n }\n animations[key] = spriteList;\n }\n textureObj.frames = newFrames;\n const spriteSheet = new Spritesheet(texture, textureObj);\n spriteSheet.parse(() => {\n const { textures } = spriteSheet;\n const spriteFrames = [];\n for (const key in textures) {\n spriteFrames.push(textures[key]);\n }\n r(spriteFrames);\n });\n });\n});\nresource.registerDestroy(RESOURCE_TYPE.SPRITE_ANIMATION, ({ instance }) => {\n if (!instance) return;\n for (const texture of instance) {\n texture.destroy(true);\n }\n});\n\n@decorators.componentObserver({\n SpriteAnimation: ['speed', 'resource'],\n})\nexport default class SpriteAnimation extends Renderer {\n static systemName = 'SpriteAnimation';\n name: string = 'SpriteAnimation';\n animates: { [propName: number]: SpriteAnimationEngine } = {};\n autoPlay: { [propName: number]: boolean } = {};\n renderSystem: RendererSystem;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n init() {\n this.renderSystem = this.game.getSystem(RendererSystem) as RendererSystem;\n this.renderSystem.rendererManager.register(this);\n }\n rendererUpdate(gameObject: GameObject) {\n const { width, height } = gameObject.transform.size;\n if (this.animates[gameObject.id]) {\n this.animates[gameObject.id].animatedSprite.width = width;\n this.animates[gameObject.id].animatedSprite.height = height;\n }\n }\n async componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'SpriteAnimation') {\n const component: SpriteAnimationComponent = changed.component as SpriteAnimationComponent;\n this.autoPlay[changed.gameObject.id] = component.autoPlay;\n if (changed.type === OBSERVER_TYPE.ADD) {\n const { instance: frames } = await resource.getResource(component.resource);\n if (!frames) {\n console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);\n }\n this.add({\n frames: frames,\n id: changed.gameObject.id,\n component,\n });\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n if (changed.prop && changed.prop.prop[0] === 'speed') {\n this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;\n } else {\n const { instance: frames } = await resource.getResource(component.resource);\n if (!frames) {\n console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);\n }\n this.change({\n frames: frames,\n id: changed.gameObject.id,\n component,\n });\n }\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.remove(changed.gameObject.id);\n }\n }\n }\n add({ frames, id, component }) {\n const animate = new SpriteAnimationEngine({ frames });\n this.animates[id] = animate;\n this.containerManager.getContainer(id).addChildAt(animate.animatedSprite, 0);\n\n animate.animatedSprite.onComplete = () => {\n component.emit('complete');\n };\n animate.animatedSprite.onFrameChange = () => {\n component.emit('frameChange');\n };\n animate.animatedSprite.onLoop = () => {\n component.emit('loop');\n };\n\n component.animate = this.animates[id];\n this.animates[id].speed = 1000 / 60 / component.speed;\n if (this.autoPlay[id]) {\n animate.animatedSprite.play();\n }\n }\n change({ frames, id, component }) {\n this.remove(id, true);\n this.add({ frames, id, component });\n }\n remove(id, isChange?: boolean) {\n const animate = this.animates[id];\n this.autoPlay[id] = animate.animatedSprite.playing;\n this.containerManager.getContainer(id).removeChild(animate.animatedSprite);\n animate.animatedSprite.destroy({ children: true });\n delete this.animates[id];\n if (!isChange) {\n delete this.autoPlay[id];\n }\n }\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__decorate","decorators","target","key","desc","c","arguments","length","r","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","push","__values","o","s","m","_this","Infinity","SpriteAnimation","obj","assign","on","count","times","animate","stop","emit","play","waitPlay","waitStop","_animate","val","frameNumber","gotoAndPlay","gotoAndStop","IDEProp","Component","resourceKeySplit","registerInstance","RESOURCE_TYPE","SPRITE_ANIMATION","_a","name","data","textureObj","json","texture","BaseTexture","from","image","frames","animations","newFrames","spriteList","_b","spriteName","newSpriteName","spriteSheet","Spritesheet","parse","textures","spriteFrames","registerDestroy","instance","instance_1","destroy","renderSystem","game","getSystem","RendererSystem","rendererManager","register","gameObject","transform","size","width","height","animates","id","animatedSprite","changed","componentName","component","autoPlay","type","OBSERVER_TYPE","ADD","resource","getResource","frames_1","console","error","add","CHANGE","prop","speed","frames_2","change","REMOVE","remove","SpriteAnimationEngine","containerManager","getContainer","addChildAt","onComplete","onFrameChange","onLoop","isChange","playing","removeChild","children","componentObserver","Renderer"],"mappings":"kDAgBA,IAAIA,EAAgB,SA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e6B,QAC3C3J,KAAKoJ,iBAAiBC,aAAaxB,GAAI+B,YAAYrF,EAAQuD,gBAC3DvD,EAAQuD,eAAed,QAAQ,CAAE6C,UAAU,WACpC7J,KAAK4H,SAASC,GAChB6B,UACI1J,KAAKkI,SAASL,IAnFlB5D,aAAa,kBADDA,KAHpB5D,aAAWyJ,kBAAkB,CAC5B7F,gBAAiB,CAAC,QAAS,eAERA,IAAwB8F"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var eva_js = require('@eva/eva.js');
|
|
6
|
+
var inspectorDecorator = require('@eva/inspector-decorator');
|
|
6
7
|
var pluginRenderer = require('@eva/plugin-renderer');
|
|
7
8
|
var rendererAdapter = require('@eva/renderer-adapter');
|
|
8
9
|
var pixi_js = require('pixi.js');
|
|
@@ -98,10 +99,12 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
98
99
|
_this.resource = '';
|
|
99
100
|
_this.autoPlay = true;
|
|
100
101
|
_this.speed = 100;
|
|
102
|
+
_this.forwards = false;
|
|
101
103
|
_this.waitPlay = false;
|
|
102
104
|
_this.waitStop = false;
|
|
103
105
|
_this.times = Infinity;
|
|
104
106
|
_this.count = 0;
|
|
107
|
+
_this.complete = false;
|
|
105
108
|
return _this;
|
|
106
109
|
}
|
|
107
110
|
SpriteAnimation.prototype.init = function (obj) {
|
|
@@ -109,7 +112,13 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
109
112
|
obj && Object.assign(this, obj);
|
|
110
113
|
this.on('loop', function () {
|
|
111
114
|
if (++_this.count >= _this.times) {
|
|
112
|
-
_this.
|
|
115
|
+
if (_this.forwards) {
|
|
116
|
+
_this.gotoAndStop(_this.totalFrames - 1);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
_this.animate.stop();
|
|
120
|
+
}
|
|
121
|
+
_this.complete = true;
|
|
113
122
|
_this.emit('complete');
|
|
114
123
|
}
|
|
115
124
|
});
|
|
@@ -124,8 +133,12 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
124
133
|
this.waitPlay = true;
|
|
125
134
|
}
|
|
126
135
|
else {
|
|
136
|
+
if (this.complete) {
|
|
137
|
+
this.gotoAndStop(0);
|
|
138
|
+
}
|
|
127
139
|
this.animate.play();
|
|
128
140
|
this.count = 0;
|
|
141
|
+
this.complete = false;
|
|
129
142
|
}
|
|
130
143
|
};
|
|
131
144
|
SpriteAnimation.prototype.stop = function () {
|
|
@@ -160,16 +173,36 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
160
173
|
SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
|
|
161
174
|
this.animate.gotoAndStop(frameNumber);
|
|
162
175
|
};
|
|
176
|
+
Object.defineProperty(SpriteAnimation.prototype, "currentFrame", {
|
|
177
|
+
get: function () {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.currentFrame;
|
|
180
|
+
},
|
|
181
|
+
enumerable: false,
|
|
182
|
+
configurable: true
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(SpriteAnimation.prototype, "totalFrames", {
|
|
185
|
+
get: function () {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.totalFrames;
|
|
188
|
+
},
|
|
189
|
+
enumerable: false,
|
|
190
|
+
configurable: true
|
|
191
|
+
});
|
|
163
192
|
SpriteAnimation.componentName = 'SpriteAnimation';
|
|
164
193
|
__decorate([
|
|
165
|
-
|
|
194
|
+
inspectorDecorator.type('string')
|
|
166
195
|
], SpriteAnimation.prototype, "resource", void 0);
|
|
167
196
|
__decorate([
|
|
168
|
-
|
|
197
|
+
inspectorDecorator.type('boolean')
|
|
169
198
|
], SpriteAnimation.prototype, "autoPlay", void 0);
|
|
170
199
|
__decorate([
|
|
171
|
-
|
|
200
|
+
inspectorDecorator.type('number'),
|
|
201
|
+
inspectorDecorator.step(10)
|
|
172
202
|
], SpriteAnimation.prototype, "speed", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
inspectorDecorator.type('boolean')
|
|
205
|
+
], SpriteAnimation.prototype, "forwards", void 0);
|
|
173
206
|
return SpriteAnimation;
|
|
174
207
|
}(eva_js.Component));
|
|
175
208
|
var SpriteAnimation$3 = SpriteAnimation$2;
|
|
@@ -261,17 +294,21 @@ var SpriteAnimation = (function (_super) {
|
|
|
261
294
|
};
|
|
262
295
|
SpriteAnimation.prototype.componentChanged = function (changed) {
|
|
263
296
|
return __awaiter(this, void 0, void 0, function () {
|
|
264
|
-
var component, frames_1, frames_2;
|
|
297
|
+
var gameObjectId, component, asyncId, frames_1, asyncId, frames_2;
|
|
265
298
|
return __generator(this, function (_a) {
|
|
266
299
|
switch (_a.label) {
|
|
267
300
|
case 0:
|
|
301
|
+
gameObjectId = changed.gameObject.id;
|
|
268
302
|
if (!(changed.componentName === 'SpriteAnimation')) return [3, 7];
|
|
269
303
|
component = changed.component;
|
|
270
304
|
this.autoPlay[changed.gameObject.id] = component.autoPlay;
|
|
271
305
|
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3, 2];
|
|
306
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
272
307
|
return [4, eva_js.resource.getResource(component.resource)];
|
|
273
308
|
case 1:
|
|
274
309
|
frames_1 = (_a.sent()).instance;
|
|
310
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
311
|
+
return [2];
|
|
275
312
|
if (!frames_1) {
|
|
276
313
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
277
314
|
}
|
|
@@ -286,9 +323,13 @@ var SpriteAnimation = (function (_super) {
|
|
|
286
323
|
if (!(changed.prop && changed.prop.prop[0] === 'speed')) return [3, 3];
|
|
287
324
|
this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;
|
|
288
325
|
return [3, 5];
|
|
289
|
-
case 3:
|
|
326
|
+
case 3:
|
|
327
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
328
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
290
329
|
case 4:
|
|
291
330
|
frames_2 = (_a.sent()).instance;
|
|
331
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
332
|
+
return [2];
|
|
292
333
|
if (!frames_2) {
|
|
293
334
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
294
335
|
}
|
|
@@ -301,6 +342,7 @@ var SpriteAnimation = (function (_super) {
|
|
|
301
342
|
case 5: return [3, 7];
|
|
302
343
|
case 6:
|
|
303
344
|
if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
345
|
+
this.increaseAsyncId(gameObjectId);
|
|
304
346
|
this.remove(changed.gameObject.id);
|
|
305
347
|
}
|
|
306
348
|
_a.label = 7;
|
|
@@ -336,6 +378,8 @@ var SpriteAnimation = (function (_super) {
|
|
|
336
378
|
};
|
|
337
379
|
SpriteAnimation.prototype.remove = function (id, isChange) {
|
|
338
380
|
var animate = this.animates[id];
|
|
381
|
+
if (!animate)
|
|
382
|
+
return;
|
|
339
383
|
this.autoPlay[id] = animate.animatedSprite.playing;
|
|
340
384
|
this.containerManager.getContainer(id).removeChild(animate.animatedSprite);
|
|
341
385
|
animate.animatedSprite.destroy({ children: true });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/plugin-renderer"),r=require("@eva/renderer-adapter"),n=require("pixi.js"),o=function(e,t){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/plugin-renderer"),r=require("@eva/renderer-adapter"),n=require("pixi.js"),o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function a(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function s(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function c(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}var p=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.resource="",e.autoPlay=!0,e.speed=100,e.waitPlay=!1,e.waitStop=!1,e.times=1/0,e.count=0,e}return i(r,t),r.prototype.init=function(e){var t=this;e&&Object.assign(this,e),this.on("loop",(function(){++t.count>=t.times&&(t.animate.stop(),t.emit("complete"))}))},r.prototype.play=function(e){void 0===e&&(e=1/0),0!==e&&(this.times=e,this.animate?(this.animate.play(),this.count=0):this.waitPlay=!0)},r.prototype.stop=function(){this.animate?this.animate.stop():this.waitStop=!0},Object.defineProperty(r.prototype,"animate",{get:function(){return this._animate},set:function(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())},enumerable:!1,configurable:!0}),r.prototype.gotoAndPlay=function(e){this.animate.gotoAndPlay(e)},r.prototype.gotoAndStop=function(e){this.animate.gotoAndStop(e)},r.componentName="SpriteAnimation",a([e.decorators.IDEProp],r.prototype,"resource",void 0),a([e.decorators.IDEProp],r.prototype,"autoPlay",void 0),a([e.decorators.IDEProp],r.prototype,"speed",void 0),r}(e.Component);e.resource.registerInstance(e.RESOURCE_TYPE.SPRITE_ANIMATION,(function(e){var t=e.name,r=e.data;return new Promise((function(e){var o,i,a=r.json,s=n.BaseTexture.from(r.image),p=a.frames||{},u=a.animations||{},l={};for(var m in p){l[t+"_s|r|c_"+m]=p[m]}for(var m in u){var f=[];if(u[m]&&u[m].length>=0)try{for(var d=(o=void 0,c(u[m])),h=d.next();!h.done;h=d.next()){var y=h.value,v=t+"_s|r|c_"+y;f.push(v)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}u[m]=f}a.frames=l;var g=new n.Spritesheet(s,a);g.parse((function(){var t=g.textures,r=[];for(var n in t)r.push(t[n]);e(r)}))}))})),e.resource.registerDestroy(e.RESOURCE_TYPE.SPRITE_ANIMATION,(function(e){var t,r,n=e.instance;if(n)try{for(var o=c(n),i=o.next();!i.done;i=o.next()){i.value.destroy(!0)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}));var u=function(n){function o(){var e=null!==n&&n.apply(this,arguments)||this;return e.name="SpriteAnimation",e.animates={},e.autoPlay={},e}return i(o,n),o.prototype.init=function(){this.renderSystem=this.game.getSystem(t.RendererSystem),this.renderSystem.rendererManager.register(this)},o.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=r,this.animates[e.id].animatedSprite.height=n)},o.prototype.componentChanged=function(t){return r=this,n=void 0,i=function(){var r,n,o;return s(this,(function(i){switch(i.label){case 0:return"SpriteAnimation"!==t.componentName?[3,7]:(r=t.component,this.autoPlay[t.gameObject.id]=r.autoPlay,t.type!==e.OBSERVER_TYPE.ADD?[3,2]:[4,e.resource.getResource(r.resource)]);case 1:return(n=i.sent().instance)||console.error("GameObject:"+t.gameObject.name+"'s Img resource load error"),this.add({frames:n,id:t.gameObject.id,component:r}),[3,7];case 2:return t.type!==e.OBSERVER_TYPE.CHANGE?[3,6]:t.prop&&"speed"===t.prop.prop[0]?(this.animates[t.gameObject.id].speed=1e3/60/r.speed,[3,5]):[3,3];case 3:return[4,e.resource.getResource(r.resource)];case 4:(o=i.sent().instance)||console.error("GameObject:"+t.gameObject.name+"'s Img resource load error"),this.change({frames:o,id:t.gameObject.id,component:r}),i.label=5;case 5:return[3,7];case 6:t.type===e.OBSERVER_TYPE.REMOVE&&this.remove(t.gameObject.id),i.label=7;case 7:return[2]}}))},new((o=void 0)||(o=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){t.done?e(t.value):new o((function(e){e(t.value)})).then(a,s)}c((i=i.apply(r,n||[])).next())}));var r,n,o,i},o.prototype.add=function(e){var t=e.frames,n=e.id,o=e.component,i=new r.SpriteAnimation({frames:t});this.animates[n]=i,this.containerManager.getContainer(n).addChildAt(i.animatedSprite,0),i.animatedSprite.onComplete=function(){o.emit("complete")},i.animatedSprite.onFrameChange=function(){o.emit("frameChange")},i.animatedSprite.onLoop=function(){o.emit("loop")},o.animate=this.animates[n],this.animates[n].speed=1e3/60/o.speed,this.autoPlay[n]&&i.animatedSprite.play()},o.prototype.change=function(e){var t=e.frames,r=e.id,n=e.component;this.remove(r,!0),this.add({frames:t,id:r,component:n})},o.prototype.remove=function(e,t){var r=this.animates[e];this.autoPlay[e]=r.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(r.animatedSprite),r.animatedSprite.destroy({children:!0}),delete this.animates[e],t||delete this.autoPlay[e]},o.systemName="SpriteAnimation",o=a([e.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],o)}(t.Renderer);exports.SpriteAnimation=p,exports.SpriteAnimationSystem=u;
|
|
2
|
+
//# sourceMappingURL=plugin-renderer-sprite-animation.cjs.prod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-renderer-sprite-animation.cjs.prod.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component, decorators } from '@eva/eva.js';\nimport { SpriteAnimation as SpriteAnimationEngine } from '@eva/renderer-adapter';\n\nexport interface SpriteAnimationParams {\n resource: string;\n autoPlay: boolean;\n speed: number;\n}\n\nexport default class SpriteAnimation extends Component<SpriteAnimationParams> {\n static componentName: string = 'SpriteAnimation';\n @decorators.IDEProp resource: string = '';\n @decorators.IDEProp autoPlay: boolean = true;\n @decorators.IDEProp speed: number = 100;\n _animate: SpriteAnimationEngine;\n private waitPlay: boolean = false;\n private waitStop: boolean = false;\n private times: number = Infinity;\n private count: number = 0;\n init(obj?: SpriteAnimationParams) {\n obj && Object.assign(this, obj);\n this.on('loop', () => {\n if (++this.count >= this.times) {\n this.animate.stop();\n this.emit('complete');\n }\n });\n }\n play(times = Infinity) {\n if (times === 0) {\n return;\n }\n this.times = times;\n if (!this.animate) {\n this.waitPlay = true;\n } else {\n this.animate.play();\n this.count = 0;\n }\n }\n stop() {\n if (!this.animate) {\n this.waitStop = true;\n } else {\n this.animate.stop();\n }\n }\n set animate(val) {\n this._animate = val;\n if (this.waitPlay) {\n this.waitPlay = false;\n this.play(this.times);\n }\n if (this.waitStop) {\n this.waitStop = false;\n this.stop();\n }\n }\n get animate() {\n return this._animate;\n }\n gotoAndPlay(frameNumber) {\n this.animate.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber) {\n this.animate.gotoAndStop(frameNumber);\n }\n}\n","import { GameObject, decorators, resource, ComponentChanged, RESOURCE_TYPE, OBSERVER_TYPE } from '@eva/eva.js';\nimport { RendererManager, ContainerManager, RendererSystem, Renderer } from '@eva/plugin-renderer';\nimport { SpriteAnimation as SpriteAnimationEngine } from '@eva/renderer-adapter';\nimport { Spritesheet, BaseTexture } from 'pixi.js';\n\nimport SpriteAnimationComponent from './component';\n\nconst resourceKeySplit = '_s|r|c_';\n\nresource.registerInstance(RESOURCE_TYPE.SPRITE_ANIMATION, ({ name, data }) => {\n return new Promise(r => {\n const textureObj = data.json;\n const texture = BaseTexture.from(data.image);\n const frames = textureObj.frames || {};\n const animations = textureObj.animations || {};\n const newFrames = {};\n for (const key in frames) {\n const newKey = name + resourceKeySplit + key;\n newFrames[newKey] = frames[key];\n }\n for (const key in animations) {\n const spriteList = [];\n if (animations[key] && animations[key].length >= 0) {\n for (const spriteName of animations[key]) {\n const newSpriteName = name + resourceKeySplit + spriteName;\n spriteList.push(newSpriteName);\n }\n }\n animations[key] = spriteList;\n }\n textureObj.frames = newFrames;\n const spriteSheet = new Spritesheet(texture, textureObj);\n spriteSheet.parse(() => {\n const { textures } = spriteSheet;\n const spriteFrames = [];\n for (const key in textures) {\n spriteFrames.push(textures[key]);\n }\n r(spriteFrames);\n });\n });\n});\nresource.registerDestroy(RESOURCE_TYPE.SPRITE_ANIMATION, ({ instance }) => {\n if (!instance) return;\n for (const texture of instance) {\n texture.destroy(true);\n }\n});\n\n@decorators.componentObserver({\n SpriteAnimation: ['speed', 'resource'],\n})\nexport default class SpriteAnimation extends Renderer {\n static systemName = 'SpriteAnimation';\n name: string = 'SpriteAnimation';\n animates: { [propName: number]: SpriteAnimationEngine } = {};\n autoPlay: { [propName: number]: boolean } = {};\n renderSystem: RendererSystem;\n rendererManager: RendererManager;\n containerManager: ContainerManager;\n init() {\n this.renderSystem = this.game.getSystem(RendererSystem) as RendererSystem;\n this.renderSystem.rendererManager.register(this);\n }\n rendererUpdate(gameObject: GameObject) {\n const { width, height } = gameObject.transform.size;\n if (this.animates[gameObject.id]) {\n this.animates[gameObject.id].animatedSprite.width = width;\n this.animates[gameObject.id].animatedSprite.height = height;\n }\n }\n async componentChanged(changed: ComponentChanged) {\n if (changed.componentName === 'SpriteAnimation') {\n const component: SpriteAnimationComponent = changed.component as SpriteAnimationComponent;\n this.autoPlay[changed.gameObject.id] = component.autoPlay;\n if (changed.type === OBSERVER_TYPE.ADD) {\n const { instance: frames } = await resource.getResource(component.resource);\n if (!frames) {\n console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);\n }\n this.add({\n frames: frames,\n id: changed.gameObject.id,\n component,\n });\n } else if (changed.type === OBSERVER_TYPE.CHANGE) {\n if (changed.prop && changed.prop.prop[0] === 'speed') {\n this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;\n } else {\n const { instance: frames } = await resource.getResource(component.resource);\n if (!frames) {\n console.error(`GameObject:${changed.gameObject.name}'s Img resource load error`);\n }\n this.change({\n frames: frames,\n id: changed.gameObject.id,\n component,\n });\n }\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.remove(changed.gameObject.id);\n }\n }\n }\n add({ frames, id, component }) {\n const animate = new SpriteAnimationEngine({ frames });\n this.animates[id] = animate;\n this.containerManager.getContainer(id).addChildAt(animate.animatedSprite, 0);\n\n animate.animatedSprite.onComplete = () => {\n component.emit('complete');\n };\n animate.animatedSprite.onFrameChange = () => {\n component.emit('frameChange');\n };\n animate.animatedSprite.onLoop = () => {\n component.emit('loop');\n };\n\n component.animate = this.animates[id];\n this.animates[id].speed = 1000 / 60 / component.speed;\n if (this.autoPlay[id]) {\n animate.animatedSprite.play();\n }\n }\n change({ frames, id, component }) {\n this.remove(id, true);\n this.add({ frames, id, component });\n }\n remove(id, isChange?: boolean) {\n const animate = this.animates[id];\n this.autoPlay[id] = animate.animatedSprite.playing;\n this.containerManager.getContainer(id).removeChild(animate.animatedSprite);\n animate.animatedSprite.destroy({ children: true });\n delete this.animates[id];\n if (!isChange) {\n delete this.autoPlay[id];\n }\n }\n}\n"],"names":["_this","Infinity","__extends","SpriteAnimation","obj","Object","assign","this","on","count","times","animate","stop","emit","play","waitPlay","waitStop","_animate","val","frameNumber","gotoAndPlay","gotoAndStop","__decorate","decorators","IDEProp","Component","resource","registerInstance","RESOURCE_TYPE","SPRITE_ANIMATION","_a","name","data","Promise","r","textureObj","json","texture","BaseTexture","from","image","frames","animations","newFrames","key","spriteList","length","_b","__values","spriteName","newSpriteName","push","spriteSheet","Spritesheet","parse","textures","spriteFrames","registerDestroy","instance","instance_1","destroy","renderSystem","game","getSystem","RendererSystem","rendererManager","register","gameObject","transform","size","width","height","animates","id","animatedSprite","changed","componentName","component","autoPlay","type","OBSERVER_TYPE","ADD","getResource","frames_1","console","error","add","CHANGE","prop","speed","frames_2","change","REMOVE","remove","SpriteAnimationEngine","containerManager","getContainer","addChildAt","onComplete","onFrameChange","onLoop","isChange","playing","removeChild","children","componentObserver","Renderer"],"mappings":"+/DASA,kBAAA,aAAA,qDAEsBA,WAAmB,GACnBA,YAAoB,EACpBA,QAAgB,IAE5BA,YAAoB,EACpBA,YAAoB,EACpBA,QAAgBC,EAAAA,EAChBD,QAAgB,IAiD1B,OA1D6CE,OAU3CC,iBAAA,SAAKC,GAAL,WACEA,GAAOC,OAAOC,OAAOC,KAAMH,GAC3BG,KAAKC,GAAG,QAAQ,aACRR,EAAKS,OAAST,EAAKU,QACvBV,EAAKW,QAAQC,OACbZ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';
|
|
2
|
+
import { ComponentChanged } from '@eva/eva.js';
|
|
3
|
+
import { ContainerManager } from '@eva/plugin-renderer';
|
|
4
|
+
import { GameObject } from '@eva/eva.js';
|
|
5
|
+
import { Renderer } from '@eva/plugin-renderer';
|
|
6
|
+
import { RendererManager } from '@eva/plugin-renderer';
|
|
7
|
+
import { RendererSystem } from '@eva/plugin-renderer';
|
|
8
|
+
import { SpriteAnimation as SpriteAnimation_2 } from '@eva/renderer-adapter';
|
|
9
|
+
|
|
10
|
+
export declare class SpriteAnimation extends Component<SpriteAnimationParams> {
|
|
11
|
+
static componentName: string;
|
|
12
|
+
resource: string;
|
|
13
|
+
autoPlay: boolean;
|
|
14
|
+
speed: number;
|
|
15
|
+
_animate: SpriteAnimation_2;
|
|
16
|
+
private waitPlay;
|
|
17
|
+
private waitStop;
|
|
18
|
+
private times;
|
|
19
|
+
private count;
|
|
20
|
+
init(obj?: SpriteAnimationParams): void;
|
|
21
|
+
play(times?: number): void;
|
|
22
|
+
stop(): void;
|
|
23
|
+
set animate(val: SpriteAnimation_2);
|
|
24
|
+
get animate(): SpriteAnimation_2;
|
|
25
|
+
gotoAndPlay(frameNumber: any): void;
|
|
26
|
+
gotoAndStop(frameNumber: any): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare interface SpriteAnimationParams {
|
|
30
|
+
resource: string;
|
|
31
|
+
autoPlay: boolean;
|
|
32
|
+
speed: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare class SpriteAnimationSystem extends Renderer {
|
|
36
|
+
static systemName: string;
|
|
37
|
+
name: string;
|
|
38
|
+
animates: {
|
|
39
|
+
[propName: number]: SpriteAnimation_2;
|
|
40
|
+
};
|
|
41
|
+
autoPlay: {
|
|
42
|
+
[propName: number]: boolean;
|
|
43
|
+
};
|
|
44
|
+
renderSystem: RendererSystem;
|
|
45
|
+
rendererManager: RendererManager;
|
|
46
|
+
containerManager: ContainerManager;
|
|
47
|
+
init(): void;
|
|
48
|
+
rendererUpdate(gameObject: GameObject): void;
|
|
49
|
+
componentChanged(changed: ComponentChanged): Promise<void>;
|
|
50
|
+
add({ frames, id, component }: {
|
|
51
|
+
frames: any;
|
|
52
|
+
id: any;
|
|
53
|
+
component: any;
|
|
54
|
+
}): void;
|
|
55
|
+
change({ frames, id, component }: {
|
|
56
|
+
frames: any;
|
|
57
|
+
id: any;
|
|
58
|
+
component: any;
|
|
59
|
+
}): void;
|
|
60
|
+
remove(id: any, isChange?: boolean): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, resource, RESOURCE_TYPE, decorators, OBSERVER_TYPE } from '@eva/eva.js';
|
|
2
|
+
import { type, step } from '@eva/inspector-decorator';
|
|
2
3
|
import { RendererSystem, Renderer } from '@eva/plugin-renderer';
|
|
3
4
|
import { SpriteAnimation as SpriteAnimation$4 } from '@eva/renderer-adapter';
|
|
4
5
|
import { BaseTexture, Spritesheet } from 'pixi.js';
|
|
@@ -94,10 +95,12 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
94
95
|
_this.resource = '';
|
|
95
96
|
_this.autoPlay = true;
|
|
96
97
|
_this.speed = 100;
|
|
98
|
+
_this.forwards = false;
|
|
97
99
|
_this.waitPlay = false;
|
|
98
100
|
_this.waitStop = false;
|
|
99
101
|
_this.times = Infinity;
|
|
100
102
|
_this.count = 0;
|
|
103
|
+
_this.complete = false;
|
|
101
104
|
return _this;
|
|
102
105
|
}
|
|
103
106
|
SpriteAnimation.prototype.init = function (obj) {
|
|
@@ -105,7 +108,13 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
105
108
|
obj && Object.assign(this, obj);
|
|
106
109
|
this.on('loop', function () {
|
|
107
110
|
if (++_this.count >= _this.times) {
|
|
108
|
-
_this.
|
|
111
|
+
if (_this.forwards) {
|
|
112
|
+
_this.gotoAndStop(_this.totalFrames - 1);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
_this.animate.stop();
|
|
116
|
+
}
|
|
117
|
+
_this.complete = true;
|
|
109
118
|
_this.emit('complete');
|
|
110
119
|
}
|
|
111
120
|
});
|
|
@@ -120,8 +129,12 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
120
129
|
this.waitPlay = true;
|
|
121
130
|
}
|
|
122
131
|
else {
|
|
132
|
+
if (this.complete) {
|
|
133
|
+
this.gotoAndStop(0);
|
|
134
|
+
}
|
|
123
135
|
this.animate.play();
|
|
124
136
|
this.count = 0;
|
|
137
|
+
this.complete = false;
|
|
125
138
|
}
|
|
126
139
|
};
|
|
127
140
|
SpriteAnimation.prototype.stop = function () {
|
|
@@ -156,16 +169,36 @@ var SpriteAnimation$2 = (function (_super) {
|
|
|
156
169
|
SpriteAnimation.prototype.gotoAndStop = function (frameNumber) {
|
|
157
170
|
this.animate.gotoAndStop(frameNumber);
|
|
158
171
|
};
|
|
172
|
+
Object.defineProperty(SpriteAnimation.prototype, "currentFrame", {
|
|
173
|
+
get: function () {
|
|
174
|
+
var _a, _b;
|
|
175
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.currentFrame;
|
|
176
|
+
},
|
|
177
|
+
enumerable: false,
|
|
178
|
+
configurable: true
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(SpriteAnimation.prototype, "totalFrames", {
|
|
181
|
+
get: function () {
|
|
182
|
+
var _a, _b;
|
|
183
|
+
return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.totalFrames;
|
|
184
|
+
},
|
|
185
|
+
enumerable: false,
|
|
186
|
+
configurable: true
|
|
187
|
+
});
|
|
159
188
|
SpriteAnimation.componentName = 'SpriteAnimation';
|
|
160
189
|
__decorate([
|
|
161
|
-
|
|
190
|
+
type('string')
|
|
162
191
|
], SpriteAnimation.prototype, "resource", void 0);
|
|
163
192
|
__decorate([
|
|
164
|
-
|
|
193
|
+
type('boolean')
|
|
165
194
|
], SpriteAnimation.prototype, "autoPlay", void 0);
|
|
166
195
|
__decorate([
|
|
167
|
-
|
|
196
|
+
type('number'),
|
|
197
|
+
step(10)
|
|
168
198
|
], SpriteAnimation.prototype, "speed", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
type('boolean')
|
|
201
|
+
], SpriteAnimation.prototype, "forwards", void 0);
|
|
169
202
|
return SpriteAnimation;
|
|
170
203
|
}(Component));
|
|
171
204
|
var SpriteAnimation$3 = SpriteAnimation$2;
|
|
@@ -257,17 +290,21 @@ var SpriteAnimation = (function (_super) {
|
|
|
257
290
|
};
|
|
258
291
|
SpriteAnimation.prototype.componentChanged = function (changed) {
|
|
259
292
|
return __awaiter(this, void 0, void 0, function () {
|
|
260
|
-
var component, frames_1, frames_2;
|
|
293
|
+
var gameObjectId, component, asyncId, frames_1, asyncId, frames_2;
|
|
261
294
|
return __generator(this, function (_a) {
|
|
262
295
|
switch (_a.label) {
|
|
263
296
|
case 0:
|
|
297
|
+
gameObjectId = changed.gameObject.id;
|
|
264
298
|
if (!(changed.componentName === 'SpriteAnimation')) return [3, 7];
|
|
265
299
|
component = changed.component;
|
|
266
300
|
this.autoPlay[changed.gameObject.id] = component.autoPlay;
|
|
267
301
|
if (!(changed.type === OBSERVER_TYPE.ADD)) return [3, 2];
|
|
302
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
268
303
|
return [4, resource.getResource(component.resource)];
|
|
269
304
|
case 1:
|
|
270
305
|
frames_1 = (_a.sent()).instance;
|
|
306
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
307
|
+
return [2];
|
|
271
308
|
if (!frames_1) {
|
|
272
309
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
273
310
|
}
|
|
@@ -282,9 +319,13 @@ var SpriteAnimation = (function (_super) {
|
|
|
282
319
|
if (!(changed.prop && changed.prop.prop[0] === 'speed')) return [3, 3];
|
|
283
320
|
this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;
|
|
284
321
|
return [3, 5];
|
|
285
|
-
case 3:
|
|
322
|
+
case 3:
|
|
323
|
+
asyncId = this.increaseAsyncId(gameObjectId);
|
|
324
|
+
return [4, resource.getResource(component.resource)];
|
|
286
325
|
case 4:
|
|
287
326
|
frames_2 = (_a.sent()).instance;
|
|
327
|
+
if (!this.validateAsyncId(gameObjectId, asyncId))
|
|
328
|
+
return [2];
|
|
288
329
|
if (!frames_2) {
|
|
289
330
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
290
331
|
}
|
|
@@ -297,6 +338,7 @@ var SpriteAnimation = (function (_super) {
|
|
|
297
338
|
case 5: return [3, 7];
|
|
298
339
|
case 6:
|
|
299
340
|
if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
341
|
+
this.increaseAsyncId(gameObjectId);
|
|
300
342
|
this.remove(changed.gameObject.id);
|
|
301
343
|
}
|
|
302
344
|
_a.label = 7;
|
|
@@ -332,6 +374,8 @@ var SpriteAnimation = (function (_super) {
|
|
|
332
374
|
};
|
|
333
375
|
SpriteAnimation.prototype.remove = function (id, isChange) {
|
|
334
376
|
var animate = this.animates[id];
|
|
377
|
+
if (!animate)
|
|
378
|
+
return;
|
|
335
379
|
this.autoPlay[id] = animate.animatedSprite.playing;
|
|
336
380
|
this.containerManager.getContainer(id).removeChild(animate.animatedSprite);
|
|
337
381
|
animate.animatedSprite.destroy({ children: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-sprite-animation",
|
|
3
|
-
"version": "1.1.1-fix.
|
|
3
|
+
"version": "1.1.1-fix.2",
|
|
4
4
|
"description": "@eva/plugin-renderer-sprite-animation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-sprite-animation.esm.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eva/plugin-renderer": "1.1.1-fix.
|
|
22
|
-
"@eva/renderer-adapter": "1.1.1-fix.
|
|
23
|
-
"@eva/eva.js": "1.1.1-fix.
|
|
21
|
+
"@eva/plugin-renderer": "1.1.1-fix.2",
|
|
22
|
+
"@eva/renderer-adapter": "1.1.1-fix.2",
|
|
23
|
+
"@eva/eva.js": "1.1.1-fix.2",
|
|
24
24
|
"pixi.js": "^4.8.7"
|
|
25
25
|
}
|
|
26
26
|
}
|