@eva/plugin-renderer-sprite-animation 1.1.1-beta.0 → 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 +615 -357
- package/dist/EVA.plugin.renderer.spriteAnimation.min.js +1 -0
- package/dist/EVA.plugin.renderer.spriteAnimation.min.js.map +1 -0
- package/dist/plugin-renderer-sprite-animation.cjs.js +57 -11
- package/dist/plugin-renderer-sprite-animation.cjs.prod.js +1 -0
- package/dist/plugin-renderer-sprite-animation.cjs.prod.js.map +1 -0
- package/dist/plugin-renderer-sprite-animation.esm.js +59 -13
- package/package.json +4 -4
- package/dist/vite-test/dist/assets/Graphics.f535ed8f.d.ts +0 -6
- package/dist/vite-test/dist/assets/Graphics.f535ed8f.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/Sprite.703a9f94.d.ts +0 -9
- package/dist/vite-test/dist/assets/Sprite.703a9f94.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/a11y.9b3ce839.d.ts +0 -4
- package/dist/vite-test/dist/assets/a11y.9b3ce839.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/component.caf56816.d.ts +0 -4
- package/dist/vite-test/dist/assets/component.caf56816.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/compressed-texture-animation.6dcf9ab4.d.ts +0 -4
- package/dist/vite-test/dist/assets/compressed-texture-animation.6dcf9ab4.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/compressed-texture-mipmap.cc4fada9.d.ts +0 -4
- package/dist/vite-test/dist/assets/compressed-texture-mipmap.cc4fada9.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/compressed-texture.07a67c9f.d.ts +0 -4
- package/dist/vite-test/dist/assets/compressed-texture.07a67c9f.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/dragonbone.bfd80a38.d.ts +0 -4
- package/dist/vite-test/dist/assets/dragonbone.bfd80a38.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/event.0de0fd28.d.ts +0 -4
- package/dist/vite-test/dist/assets/event.0de0fd28.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/graphics.df3659e9.d.ts +0 -4
- package/dist/vite-test/dist/assets/graphics.df3659e9.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/image.9d7f7b54.d.ts +0 -4
- package/dist/vite-test/dist/assets/image.9d7f7b54.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/index.cf7bfffd.d.ts +0 -2
- package/dist/vite-test/dist/assets/index.cf7bfffd.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/loader.03643d14.d.ts +0 -4
- package/dist/vite-test/dist/assets/loader.03643d14.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/lottie.8e29b509.d.ts +0 -4
- package/dist/vite-test/dist/assets/lottie.8e29b509.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/mask.c3592934.d.ts +0 -4
- package/dist/vite-test/dist/assets/mask.c3592934.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/matter.bcb02c9e.d.ts +0 -4
- package/dist/vite-test/dist/assets/matter.bcb02c9e.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/multi-canvas.a081d481.d.ts +0 -4
- package/dist/vite-test/dist/assets/multi-canvas.a081d481.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/ninePatch.ec5000f5.d.ts +0 -4
- package/dist/vite-test/dist/assets/ninePatch.ec5000f5.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/sound.81f19bb0.d.ts +0 -4
- package/dist/vite-test/dist/assets/sound.81f19bb0.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/spine.08037e2f.d.ts +0 -4
- package/dist/vite-test/dist/assets/spine.08037e2f.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/sprite.ab61ce04.d.ts +0 -4
- package/dist/vite-test/dist/assets/sprite.ab61ce04.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/spriteAnimation.fbd1b62d.d.ts +0 -4
- package/dist/vite-test/dist/assets/spriteAnimation.fbd1b62d.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/text.3e406bba.d.ts +0 -4
- package/dist/vite-test/dist/assets/text.3e406bba.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/tilingSprite.3f09d780.d.ts +0 -4
- package/dist/vite-test/dist/assets/tilingSprite.3f09d780.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/transition.f3d6a6eb.d.ts +0 -4
- package/dist/vite-test/dist/assets/transition.f3d6a6eb.d.ts.map +0 -1
- package/dist/vite-test/dist/assets/vendor.1f31f96e.d.ts +0 -5
- package/dist/vite-test/dist/assets/vendor.1f31f96e.d.ts.map +0 -1
- package/dist/vite-test/index.d.ts +0 -2
- package/dist/vite-test/index.d.ts.map +0 -1
- package/dist/vite-test/ts/a11y.d.ts +0 -3
- package/dist/vite-test/ts/a11y.d.ts.map +0 -1
- package/dist/vite-test/ts/component.d.ts +0 -3
- package/dist/vite-test/ts/component.d.ts.map +0 -1
- package/dist/vite-test/ts/compressed-texture-animation.d.ts +0 -3
- package/dist/vite-test/ts/compressed-texture-animation.d.ts.map +0 -1
- package/dist/vite-test/ts/compressed-texture-mipmap.d.ts +0 -3
- package/dist/vite-test/ts/compressed-texture-mipmap.d.ts.map +0 -1
- package/dist/vite-test/ts/compressed-texture.d.ts +0 -3
- package/dist/vite-test/ts/compressed-texture.d.ts.map +0 -1
- package/dist/vite-test/ts/dragonbone.d.ts +0 -3
- package/dist/vite-test/ts/dragonbone.d.ts.map +0 -1
- package/dist/vite-test/ts/event.d.ts +0 -3
- package/dist/vite-test/ts/event.d.ts.map +0 -1
- package/dist/vite-test/ts/graphics.d.ts +0 -3
- package/dist/vite-test/ts/graphics.d.ts.map +0 -1
- package/dist/vite-test/ts/image.d.ts +0 -3
- package/dist/vite-test/ts/image.d.ts.map +0 -1
- package/dist/vite-test/ts/loader.d.ts +0 -3
- package/dist/vite-test/ts/loader.d.ts.map +0 -1
- package/dist/vite-test/ts/lottie.d.ts +0 -3
- package/dist/vite-test/ts/lottie.d.ts.map +0 -1
- package/dist/vite-test/ts/mask.d.ts +0 -4
- package/dist/vite-test/ts/mask.d.ts.map +0 -1
- package/dist/vite-test/ts/matter.d.ts +0 -3
- package/dist/vite-test/ts/matter.d.ts.map +0 -1
- package/dist/vite-test/ts/multi-canvas.d.ts +0 -3
- package/dist/vite-test/ts/multi-canvas.d.ts.map +0 -1
- package/dist/vite-test/ts/ninePatch.d.ts +0 -3
- package/dist/vite-test/ts/ninePatch.d.ts.map +0 -1
- package/dist/vite-test/ts/sound.d.ts +0 -3
- package/dist/vite-test/ts/sound.d.ts.map +0 -1
- package/dist/vite-test/ts/spine.d.ts +0 -3
- package/dist/vite-test/ts/spine.d.ts.map +0 -1
- package/dist/vite-test/ts/sprite.d.ts +0 -3
- package/dist/vite-test/ts/sprite.d.ts.map +0 -1
- package/dist/vite-test/ts/spriteAnimation.d.ts +0 -3
- package/dist/vite-test/ts/spriteAnimation.d.ts.map +0 -1
- package/dist/vite-test/ts/text.d.ts +0 -3
- package/dist/vite-test/ts/text.d.ts.map +0 -1
- package/dist/vite-test/ts/tilingSprite.d.ts +0 -3
- package/dist/vite-test/ts/tilingSprite.d.ts.map +0 -1
- package/dist/vite-test/ts/transition.d.ts +0 -3
- package/dist/vite-test/ts/transition.d.ts.map +0 -1
|
@@ -1,359 +1,617 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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;
|
|
91
454
|
}
|
|
92
455
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (this.animates[gameObject.id]) {
|
|
256
|
-
this.animates[gameObject.id].animatedSprite.width = width;
|
|
257
|
-
this.animates[gameObject.id].animatedSprite.height = height;
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
SpriteAnimation.prototype.componentChanged = function (changed) {
|
|
261
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
262
|
-
var component, frames_1, frames_2;
|
|
263
|
-
return __generator(this, function (_a) {
|
|
264
|
-
switch (_a.label) {
|
|
265
|
-
case 0:
|
|
266
|
-
if (!(changed.componentName === 'SpriteAnimation')) return [3, 7];
|
|
267
|
-
component = changed.component;
|
|
268
|
-
this.autoPlay[changed.gameObject.id] = component.autoPlay;
|
|
269
|
-
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3, 2];
|
|
270
|
-
return [4, eva_js.resource.getResource(component.resource)];
|
|
271
|
-
case 1:
|
|
272
|
-
frames_1 = (_a.sent()).instance;
|
|
273
|
-
if (!frames_1) {
|
|
274
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
275
|
-
}
|
|
276
|
-
this.add({
|
|
277
|
-
frames: frames_1,
|
|
278
|
-
id: changed.gameObject.id,
|
|
279
|
-
component: component,
|
|
280
|
-
});
|
|
281
|
-
return [3, 7];
|
|
282
|
-
case 2:
|
|
283
|
-
if (!(changed.type === eva_js.OBSERVER_TYPE.CHANGE)) return [3, 6];
|
|
284
|
-
if (!(changed.prop && changed.prop.prop[0] === 'speed')) return [3, 3];
|
|
285
|
-
this.animates[changed.gameObject.id].speed = 1000 / 60 / component.speed;
|
|
286
|
-
return [3, 5];
|
|
287
|
-
case 3: return [4, eva_js.resource.getResource(component.resource)];
|
|
288
|
-
case 4:
|
|
289
|
-
frames_2 = (_a.sent()).instance;
|
|
290
|
-
if (!frames_2) {
|
|
291
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
292
|
-
}
|
|
293
|
-
this.change({
|
|
294
|
-
frames: frames_2,
|
|
295
|
-
id: changed.gameObject.id,
|
|
296
|
-
component: component,
|
|
297
|
-
});
|
|
298
|
-
_a.label = 5;
|
|
299
|
-
case 5: return [3, 7];
|
|
300
|
-
case 6:
|
|
301
|
-
if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
302
|
-
this.remove(changed.gameObject.id);
|
|
303
|
-
}
|
|
304
|
-
_a.label = 7;
|
|
305
|
-
case 7: return [2];
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
SpriteAnimation.prototype.add = function (_a) {
|
|
311
|
-
var frames = _a.frames, id = _a.id, component = _a.component;
|
|
312
|
-
var animate = new rendererAdapter.SpriteAnimation({ frames: frames });
|
|
313
|
-
this.animates[id] = animate;
|
|
314
|
-
this.containerManager.getContainer(id).addChildAt(animate.animatedSprite, 0);
|
|
315
|
-
animate.animatedSprite.onComplete = function () {
|
|
316
|
-
component.emit('complete');
|
|
317
|
-
};
|
|
318
|
-
animate.animatedSprite.onFrameChange = function () {
|
|
319
|
-
component.emit('frameChange');
|
|
320
|
-
};
|
|
321
|
-
animate.animatedSprite.onLoop = function () {
|
|
322
|
-
component.emit('loop');
|
|
323
|
-
};
|
|
324
|
-
component.animate = this.animates[id];
|
|
325
|
-
this.animates[id].speed = 1000 / 60 / component.speed;
|
|
326
|
-
if (this.autoPlay[id]) {
|
|
327
|
-
animate.animatedSprite.play();
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
SpriteAnimation.prototype.change = function (_a) {
|
|
331
|
-
var frames = _a.frames, id = _a.id, component = _a.component;
|
|
332
|
-
this.remove(id, true);
|
|
333
|
-
this.add({ frames: frames, id: id, component: component });
|
|
334
|
-
};
|
|
335
|
-
SpriteAnimation.prototype.remove = function (id, isChange) {
|
|
336
|
-
var animate = this.animates[id];
|
|
337
|
-
this.autoPlay[id] = animate.animatedSprite.playing;
|
|
338
|
-
this.containerManager.getContainer(id).removeChild(animate.animatedSprite);
|
|
339
|
-
animate.animatedSprite.destroy({ children: true });
|
|
340
|
-
delete this.animates[id];
|
|
341
|
-
if (!isChange) {
|
|
342
|
-
delete this.autoPlay[id];
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
SpriteAnimation.systemName = 'SpriteAnimation';
|
|
346
|
-
SpriteAnimation = __decorate([
|
|
347
|
-
eva_js.decorators.componentObserver({
|
|
348
|
-
SpriteAnimation: ['speed', 'resource'],
|
|
349
|
-
})
|
|
350
|
-
], SpriteAnimation);
|
|
351
|
-
return SpriteAnimation;
|
|
352
|
-
}(pluginRenderer.Renderer));
|
|
353
|
-
|
|
354
|
-
exports.SpriteAnimation = SpriteAnimation$1;
|
|
355
|
-
exports.SpriteAnimationSystem = SpriteAnimation;
|
|
356
|
-
|
|
357
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
358
|
-
|
|
359
|
-
})));
|
|
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;
|