@eva/plugin-renderer-sprite 1.2.7-editor.10 → 1.2.7-editor.11

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.
@@ -31,22 +31,6 @@ var _EVA_IIFE_sprite = function (exports, eva_js, pluginRenderer, pixi_js) {
31
31
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32
32
  }
33
33
 
34
- var _assign = function __assign() {
35
- _assign = Object.assign || function __assign(t) {
36
- for (var s, i = 1, n = arguments.length; i < n; i++) {
37
- s = arguments[i];
38
-
39
- for (var p in s) {
40
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- }
43
-
44
- return t;
45
- };
46
-
47
- return _assign.apply(this, arguments);
48
- };
49
-
50
34
  function __decorate(decorators, target, key, desc) {
51
35
  var c = arguments.length,
52
36
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
@@ -57,10 +41,6 @@ var _EVA_IIFE_sprite = function (exports, eva_js, pluginRenderer, pixi_js) {
57
41
  return c > 3 && r && Object.defineProperty(target, key, r), r;
58
42
  }
59
43
 
60
- function __metadata(metadataKey, metadataValue) {
61
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
62
- }
63
-
64
44
  function __awaiter(thisArg, _arguments, P, generator) {
65
45
  function adopt(value) {
66
46
  return value instanceof P ? value : new P(function (resolve) {
@@ -221,123 +201,6 @@ var _EVA_IIFE_sprite = function (exports, eva_js, pluginRenderer, pixi_js) {
221
201
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
222
202
  }
223
203
 
224
- var SymbolKeysNotSupportedError = function (_super) {
225
- __extends(SymbolKeysNotSupportedError, _super);
226
-
227
- function SymbolKeysNotSupportedError() {
228
- var _newTarget = this.constructor;
229
-
230
- var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
231
-
232
- Object.setPrototypeOf(_this, _newTarget.prototype);
233
- return _this;
234
- }
235
-
236
- return SymbolKeysNotSupportedError;
237
- }(Error);
238
-
239
- (function (_super) {
240
- __extends(StaticGetPropertiesIsNotAFunctionError, _super);
241
-
242
- function StaticGetPropertiesIsNotAFunctionError() {
243
- var _newTarget = this.constructor;
244
-
245
- var _this = _super.call(this, 'getProperties is not a function!') || this;
246
-
247
- Object.setPrototypeOf(_this, _newTarget.prototype);
248
- return _this;
249
- }
250
-
251
- return StaticGetPropertiesIsNotAFunctionError;
252
- })(Error);
253
-
254
- var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
255
-
256
- function transformBasicType(type) {
257
- if (type === String) {
258
- return 'string';
259
- }
260
-
261
- if (type === Number) {
262
- return 'number';
263
- }
264
-
265
- if (type === Boolean) {
266
- return 'boolean';
267
- }
268
-
269
- return 'unknown';
270
- }
271
-
272
- function defineTypes(target, key, options, returnTypeFunction) {
273
- var type = Reflect.getMetadata('design:type', target, key);
274
- var isArray = type === Array;
275
- var str = transformBasicType(type);
276
-
277
- if (str !== 'unknown') {
278
- type = str;
279
- }
280
-
281
- if (returnTypeFunction) {
282
- var returnType = returnTypeFunction();
283
-
284
- if (Array.isArray(returnType)) {
285
- isArray = true;
286
- type = returnType[0];
287
- } else {
288
- type = returnType;
289
- }
290
- }
291
-
292
- var properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
293
- properties[key] = _assign({
294
- type: type,
295
- isArray: isArray
296
- }, options);
297
- Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
298
- }
299
-
300
- function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
301
- if (typeof returnTypeFuncOrOptions === 'function') {
302
- return {
303
- returnTypeFunc: returnTypeFuncOrOptions,
304
- options: maybeOptions || {}
305
- };
306
- }
307
-
308
- return {
309
- options: returnTypeFuncOrOptions || {}
310
- };
311
- }
312
-
313
- function Field(returnTypeFunction, maybeOptions) {
314
- return function (target, propertyKey) {
315
- if (typeof propertyKey === 'symbol') {
316
- throw new SymbolKeysNotSupportedError();
317
- }
318
-
319
- var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
320
- options = _a.options,
321
- returnTypeFunc = _a.returnTypeFunc;
322
-
323
- defineTypes(target, propertyKey, options, returnTypeFunc);
324
- };
325
- }
326
-
327
- var ExecuteMode;
328
-
329
- (function (ExecuteMode) {
330
- ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
331
- ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
332
- ExecuteMode[ExecuteMode["All"] = 6] = "All";
333
- })(ExecuteMode || (ExecuteMode = {}));
334
-
335
- var sleep = function sleep(time) {
336
- return new Promise(function (resolve) {
337
- return setTimeout(resolve, time);
338
- });
339
- };
340
-
341
204
  var Sprite$3 = function (_super) {
342
205
  __extends(Sprite, _super);
343
206
 
@@ -357,49 +220,6 @@ var _EVA_IIFE_sprite = function (exports, eva_js, pluginRenderer, pixi_js) {
357
220
  };
358
221
 
359
222
  Sprite.componentName = 'Sprite';
360
-
361
- __decorate([Field({
362
- type: 'resource'
363
- }), __metadata("design:type", String)], Sprite.prototype, "resource", void 0);
364
-
365
- __decorate([Field({
366
- type: 'selector',
367
- options: function options(instance) {
368
- var _a, _b, _c;
369
-
370
- return __awaiter(this, void 0, void 0, function () {
371
- var frames;
372
- return __generator(this, function (_d) {
373
- switch (_d.label) {
374
- case 0:
375
- return [4, sleep(0)];
376
-
377
- case 1:
378
- _d.sent();
379
-
380
- if (!instance.resource || !eva_js.resource.promiseMap[instance.resource]) {
381
- return [2, {}];
382
- }
383
-
384
- return [4, eva_js.resource.promiseMap[instance.resource]];
385
-
386
- case 2:
387
- _d.sent();
388
-
389
- frames = (_c = (_b = (_a = eva_js.resource.resourcesMap[instance.resource]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.json) === null || _c === void 0 ? void 0 : _c.frames;
390
- return [2, frames ? Object.values(frames).map(function (item) {
391
- return item.name;
392
- }).reduce(function (prev, key) {
393
- var _a;
394
-
395
- return _assign(_assign({}, prev), (_a = {}, _a[key] = key, _a));
396
- }, {}) : {}];
397
- }
398
- });
399
- });
400
- }
401
- }), __metadata("design:type", String)], Sprite.prototype, "spriteName", void 0);
402
-
403
223
  return Sprite;
404
224
  }(eva_js.Component);
405
225
 
@@ -1 +1 @@
1
- window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_sprite=function(e,t,r,n){"use strict";var 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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function a(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,a])}}}function l(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 f=function(e){function t(){var t=this.constructor,r=e.call(this,"Symbol keys are not supported yet!")||this;return Object.setPrototypeOf(r,t.prototype),r}return i(t,e),t}(Error);!function(e){function t(){var t=this.constructor,r=e.call(this,"getProperties is not a function!")||this;return Object.setPrototypeOf(r,t.prototype),r}i(t,e)}(Error);var d,y="IDE_PROPERTY_METADATA";function h(e,t,r,n){var o=Reflect.getMetadata("design:type",e,t),i=o===Array,a=function(e){return e===String?"string":e===Number?"number":e===Boolean?"boolean":"unknown"}(o);if("unknown"!==a&&(o=a),n){var c=n();Array.isArray(c)?(i=!0,o=c[0]):o=c}var u=Reflect.getMetadata(y,e.constructor)||{};u[t]=s({type:o,isArray:i},r),Reflect.defineMetadata(y,u,e.constructor)}function m(e,t){return function(r,n){if("symbol"==typeof n)throw new f;var o=function(e,t){return"function"==typeof e?{returnTypeFunc:e,options:t||{}}:{options:e||{}}}(e,t);h(r,n,o.options,o.returnTypeFunc)}}!function(e){e[e.Edit=2]="Edit",e[e.Game=4]="Game",e[e.All=6]="All"}(d||(d={}));var v=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.spriteName="",t}return i(r,e),r.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource,this.spriteName=e.spriteName)},r.componentName="Sprite",a([m({type:"resource"}),c("design:type",String)],r.prototype,"resource",void 0),a([m({type:"selector",options:function(e){var r,n,o;return u(this,void 0,void 0,(function(){var i;return p(this,(function(a){switch(a.label){case 0:return[4,(c=0,new Promise((function(e){return setTimeout(e,c)})))];case 1:return a.sent(),e.resource&&t.resource.promiseMap[e.resource]?[4,t.resource.promiseMap[e.resource]]:[2,{}];case 2:return a.sent(),[2,(i=null===(o=null===(n=null===(r=t.resource.resourcesMap[e.resource])||void 0===r?void 0:r.data)||void 0===n?void 0:n.json)||void 0===o?void 0:o.frames)?Object.values(i).map((function(e){return e.name})).reduce((function(e,t){var r;return s(s({},e),((r={})[t]=t,r))}),{}):{}]}var c}))}))}}),c("design:type",String)],r.prototype,"spriteName",void 0),r}(t.Component),g=v,b=function(){function e(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=n.Sprite.from(e):e instanceof n.Texture&&(this.sprite=new n.Sprite(e)):this.sprite=new n.Sprite}return Object.defineProperty(e.prototype,"image",{get:function(){return this._image},set:function(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=n.Texture.from(e)):e instanceof n.Texture&&(this.sprite.texture=e),this._image=e)},enumerable:!1,configurable:!0}),e}(),w=b,E="_s|r|c_";t.resource.registerInstance(t.RESOURCE_TYPE.SPRITE,(function(e){var t=e.name,r=e.data;return new Promise((function(e){var o,i,s=r.json,a=n.BaseTexture.from(r.image),c=s.frames||{},u=s.animations||{},p={};for(var f in c){p[t+E+f]=c[f]}for(var f in u){var d=[];if(u[f]&&u[f].length>=0)try{for(var y=(o=void 0,l(u[f])),h=y.next();!h.done;h=y.next()){var m=h.value,v=t+E+m;d.push(v)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}u[f]=d}s.frames=p;var g=new n.Spritesheet(a,s);g.parse((function(){var t=g.textures;e(t)}))}))})),t.resource.registerDestroy(t.RESOURCE_TYPE.SPRITE,(function(e){var t=e.instance;if(t)for(var r in t)t[r].destroy(!0)}));var O=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Sprite",t.sprites={},t}return i(n,e),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.sprites[e.id]&&(this.sprites[e.id].sprite.width=r,this.sprites[e.id].sprite.height=n)},n.prototype.componentChanged=function(e){return u(this,void 0,void 0,(function(){var r,n,o,i,s;return p(this,(function(a){switch(a.label){case 0:return"Sprite"!==e.componentName?[3,5]:(r=e.gameObject.id,n=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:(s=new w(null),this.sprites[e.gameObject.id]=s,this.containerManager.getContainer(e.gameObject.id).addChildAt(s.sprite,0),o=this.increaseAsyncId(r),[4,t.resource.getResource(n.resource)]));case 1:return i=a.sent().instance,this.validateAsyncId(r,o)?i?(s.image=i[n.resource+E+n.spriteName],[3,5]):(console.error("GameObject:"+e.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,4]:(o=this.increaseAsyncId(r),[4,t.resource.getResource(n.resource)]);case 3:return i=a.sent().instance,this.validateAsyncId(r,o)?i?(this.sprites[e.gameObject.id].image=i[n.resource+E+n.spriteName],[3,5]):(console.error("GameObject:"+e.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 4:e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(r),s=this.sprites[e.gameObject.id],this.containerManager.getContainer(e.gameObject.id).removeChild(s.sprite),s.sprite.destroy({children:!0}),delete this.sprites[e.gameObject.id]),a.label=5;case 5:return[2]}}))}))},n.systemName="Sprite",n=a([t.decorators.componentObserver({Sprite:["spriteName"]})],n)}(r.Renderer),S=O;return e.Sprite=g,e.SpriteSystem=S,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,PIXI);window.EVA.plugin.renderer.sprite=window.EVA.plugin.renderer.sprite||_EVA_IIFE_sprite;
1
+ window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_sprite=function(e,t,r,n){"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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");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){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function c(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 u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.spriteName="",t}return o(t,e),t.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource,this.spriteName=e.spriteName)},t.componentName="Sprite",t}(t.Component),p=u,l=function(){function e(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=n.Sprite.from(e):e instanceof n.Texture&&(this.sprite=new n.Sprite(e)):this.sprite=new n.Sprite}return Object.defineProperty(e.prototype,"image",{get:function(){return this._image},set:function(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=n.Texture.from(e)):e instanceof n.Texture&&(this.sprite.texture=e),this._image=e)},enumerable:!1,configurable:!0}),e}(),f=l,h="_s|r|c_";t.resource.registerInstance(t.RESOURCE_TYPE.SPRITE,(function(e){var t=e.name,r=e.data;return new Promise((function(e){var i,o,s=r.json,a=n.BaseTexture.from(r.image),u=s.frames||{},p=s.animations||{},l={};for(var f in u){l[t+h+f]=u[f]}for(var f in p){var d=[];if(p[f]&&p[f].length>=0)try{for(var m=(i=void 0,c(p[f])),y=m.next();!y.done;y=m.next()){var g=y.value,b=t+h+g;d.push(b)}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}p[f]=d}s.frames=l;var v=new n.Spritesheet(a,s);v.parse((function(){var t=v.textures;e(t)}))}))})),t.resource.registerDestroy(t.RESOURCE_TYPE.SPRITE,(function(e){var t=e.instance;if(t)for(var r in t)t[r].destroy(!0)}));var d=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Sprite",t.sprites={},t}return o(n,e),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.sprites[e.id]&&(this.sprites[e.id].sprite.width=r,this.sprites[e.id].sprite.height=n)},n.prototype.componentChanged=function(e){return s(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return"Sprite"!==e.componentName?[3,5]:(r=e.gameObject.id,n=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:(s=new f(null),this.sprites[e.gameObject.id]=s,this.containerManager.getContainer(e.gameObject.id).addChildAt(s.sprite,0),i=this.increaseAsyncId(r),[4,t.resource.getResource(n.resource)]));case 1:return o=a.sent().instance,this.validateAsyncId(r,i)?o?(s.image=o[n.resource+h+n.spriteName],[3,5]):(console.error("GameObject:"+e.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,4]:(i=this.increaseAsyncId(r),[4,t.resource.getResource(n.resource)]);case 3:return o=a.sent().instance,this.validateAsyncId(r,i)?o?(this.sprites[e.gameObject.id].image=o[n.resource+h+n.spriteName],[3,5]):(console.error("GameObject:"+e.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 4:e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(r),s=this.sprites[e.gameObject.id],this.containerManager.getContainer(e.gameObject.id).removeChild(s.sprite),s.sprite.destroy({children:!0}),delete this.sprites[e.gameObject.id]),a.label=5;case 5:return[2]}}))}))},n.systemName="Sprite",n=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([t.decorators.componentObserver({Sprite:["spriteName"]})],n),n}(r.Renderer),m=d;return e.Sprite=p,e.SpriteSystem=m,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,PIXI);window.EVA.plugin.renderer.sprite=window.EVA.plugin.renderer.sprite||_EVA_IIFE_sprite;
@@ -3,7 +3,6 @@
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');
7
6
  var pluginRenderer = require('@eva/plugin-renderer');
8
7
  var pixi_js = require('pixi.js');
9
8
 
@@ -36,17 +35,6 @@ function __extends(d, b) {
36
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
37
36
  }
38
37
 
39
- var __assign = function() {
40
- __assign = Object.assign || function __assign(t) {
41
- for (var s, i = 1, n = arguments.length; i < n; i++) {
42
- s = arguments[i];
43
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
-
50
38
  function __decorate(decorators, target, key, desc) {
51
39
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
52
40
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -54,10 +42,6 @@ function __decorate(decorators, target, key, desc) {
54
42
  return c > 3 && r && Object.defineProperty(target, key, r), r;
55
43
  }
56
44
 
57
- function __metadata(metadataKey, metadataValue) {
58
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
59
- }
60
-
61
45
  function __awaiter(thisArg, _arguments, P, generator) {
62
46
  return new (P || (P = Promise))(function (resolve, reject) {
63
47
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -106,7 +90,6 @@ function __values(o) {
106
90
  };
107
91
  }
108
92
 
109
- var sleep = function (time) { return new Promise(function (resolve) { return setTimeout(resolve, time); }); };
110
93
  var Sprite$3 = (function (_super) {
111
94
  __extends(Sprite, _super);
112
95
  function Sprite() {
@@ -122,44 +105,6 @@ var Sprite$3 = (function (_super) {
122
105
  }
123
106
  };
124
107
  Sprite.componentName = 'Sprite';
125
- __decorate([
126
- inspectorDecorator.Field({ type: 'resource' }),
127
- __metadata("design:type", String)
128
- ], Sprite.prototype, "resource", void 0);
129
- __decorate([
130
- inspectorDecorator.Field({
131
- type: 'selector',
132
- options: function (instance) {
133
- var _a, _b, _c;
134
- return __awaiter(this, void 0, void 0, function () {
135
- var frames;
136
- return __generator(this, function (_d) {
137
- switch (_d.label) {
138
- case 0: return [4, sleep(0)];
139
- case 1:
140
- _d.sent();
141
- if (!instance.resource || !eva_js.resource.promiseMap[instance.resource]) {
142
- return [2, {}];
143
- }
144
- return [4, eva_js.resource.promiseMap[instance.resource]];
145
- case 2:
146
- _d.sent();
147
- frames = (_c = (_b = (_a = eva_js.resource.resourcesMap[instance.resource]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.json) === null || _c === void 0 ? void 0 : _c.frames;
148
- return [2, frames
149
- ? Object.values(frames)
150
- .map(function (item) { return item.name; })
151
- .reduce(function (prev, key) {
152
- var _a;
153
- return (__assign(__assign({}, prev), (_a = {}, _a[key] = key, _a)));
154
- }, {})
155
- : {}];
156
- }
157
- });
158
- });
159
- },
160
- }),
161
- __metadata("design:type", String)
162
- ], Sprite.prototype, "spriteName", void 0);
163
108
  return Sprite;
164
109
  }(eva_js.Component));
165
110
  var Sprite$4 = Sprite$3;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/inspector-decorator"),r=require("@eva/plugin-renderer"),n=require("pixi.js"),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])},i(e,t)};function o(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(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 f=function(r){function n(){var e=null!==r&&r.apply(this,arguments)||this;return e.resource="",e.spriteName="",e}return o(n,r),n.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource,this.spriteName=e.spriteName)},n.componentName="Sprite",a([t.Field({type:"resource"}),c("design:type",String)],n.prototype,"resource",void 0),a([t.Field({type:"selector",options:function(t){var r,n,i;return u(this,void 0,void 0,(function(){var o;return p(this,(function(a){switch(a.label){case 0:return[4,(c=0,new Promise((function(e){return setTimeout(e,c)})))];case 1:return a.sent(),t.resource&&e.resource.promiseMap[t.resource]?[4,e.resource.promiseMap[t.resource]]:[2,{}];case 2:return a.sent(),[2,(o=null===(i=null===(n=null===(r=e.resource.resourcesMap[t.resource])||void 0===r?void 0:r.data)||void 0===n?void 0:n.json)||void 0===i?void 0:i.frames)?Object.values(o).map((function(e){return e.name})).reduce((function(e,t){var r;return s(s({},e),((r={})[t]=t,r))}),{}):{}]}var c}))}))}}),c("design:type",String)],n.prototype,"spriteName",void 0),n}(e.Component),d=f,h=function(){function e(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=n.Sprite.from(e):e instanceof n.Texture&&(this.sprite=new n.Sprite(e)):this.sprite=new n.Sprite}return Object.defineProperty(e.prototype,"image",{get:function(){return this._image},set:function(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=n.Texture.from(e)):e instanceof n.Texture&&(this.sprite.texture=e),this._image=e)},enumerable:!1,configurable:!0}),e}(),m=h;e.resource.registerInstance(e.RESOURCE_TYPE.SPRITE,(function(e){var t=e.name,r=e.data;return new Promise((function(e){var i,o,s=r.json,a=n.BaseTexture.from(r.image),c=s.frames||{},u=s.animations||{},p={};for(var f in c){p[t+"_s|r|c_"+f]=c[f]}for(var f in u){var d=[];if(u[f]&&u[f].length>=0)try{for(var h=(i=void 0,l(u[f])),m=h.next();!m.done;m=h.next()){var y=m.value,v=t+"_s|r|c_"+y;d.push(v)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}u[f]=d}s.frames=p;var g=new n.Spritesheet(a,s);g.parse((function(){var t=g.textures;e(t)}))}))})),e.resource.registerDestroy(e.RESOURCE_TYPE.SPRITE,(function(e){var t=e.instance;if(t)for(var r in t)t[r].destroy(!0)}));var y=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Sprite",e.sprites={},e}return o(n,t),n.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.sprites[e.id]&&(this.sprites[e.id].sprite.width=r,this.sprites[e.id].sprite.height=n)},n.prototype.componentChanged=function(t){return u(this,void 0,void 0,(function(){var r,n,i,o,s;return p(this,(function(a){switch(a.label){case 0:return"Sprite"!==t.componentName?[3,5]:(r=t.gameObject.id,n=t.component,t.type!==e.OBSERVER_TYPE.ADD?[3,2]:(s=new m(null),this.sprites[t.gameObject.id]=s,this.containerManager.getContainer(t.gameObject.id).addChildAt(s.sprite,0),i=this.increaseAsyncId(r),[4,e.resource.getResource(n.resource)]));case 1:return o=a.sent().instance,this.validateAsyncId(r,i)?o?(s.image=o[n.resource+"_s|r|c_"+n.spriteName],[3,5]):(console.error("GameObject:"+t.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 2:return t.type!==e.OBSERVER_TYPE.CHANGE?[3,4]:(i=this.increaseAsyncId(r),[4,e.resource.getResource(n.resource)]);case 3:return o=a.sent().instance,this.validateAsyncId(r,i)?o?(this.sprites[t.gameObject.id].image=o[n.resource+"_s|r|c_"+n.spriteName],[3,5]):(console.error("GameObject:"+t.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 4:t.type===e.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(r),s=this.sprites[t.gameObject.id],this.containerManager.getContainer(t.gameObject.id).removeChild(s.sprite),s.sprite.destroy({children:!0}),delete this.sprites[t.gameObject.id]),a.label=5;case 5:return[2]}}))}))},n.systemName="Sprite",n=a([e.decorators.componentObserver({Sprite:["spriteName"]})],n)}(r.Renderer);exports.Sprite=d,exports.SpriteSystem=y;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/plugin-renderer"),r=require("pixi.js"),n=function(e,t){return n=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])},n(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function o(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function s(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 a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.spriteName="",t}return i(t,e),t.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource,this.spriteName=e.spriteName)},t.componentName="Sprite",t}(e.Component),c=a,u=function(){function e(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=r.Sprite.from(e):e instanceof r.Texture&&(this.sprite=new r.Sprite(e)):this.sprite=new r.Sprite}return Object.defineProperty(e.prototype,"image",{get:function(){return this._image},set:function(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=r.Texture.from(e)):e instanceof r.Texture&&(this.sprite.texture=e),this._image=e)},enumerable:!1,configurable:!0}),e}(),p=u;e.resource.registerInstance(e.RESOURCE_TYPE.SPRITE,(function(e){var t=e.name,n=e.data;return new Promise((function(e){var i,o,a=n.json,c=r.BaseTexture.from(n.image),u=a.frames||{},p=a.animations||{},l={};for(var f in u){l[t+"_s|r|c_"+f]=u[f]}for(var f in p){var h=[];if(p[f]&&p[f].length>=0)try{for(var m=(i=void 0,s(p[f])),d=m.next();!d.done;d=m.next()){var y=d.value,g=t+"_s|r|c_"+y;h.push(g)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}p[f]=h}a.frames=l;var v=new r.Spritesheet(c,a);v.parse((function(){var t=v.textures;e(t)}))}))})),e.resource.registerDestroy(e.RESOURCE_TYPE.SPRITE,(function(e){var t=e.instance;if(t)for(var r in t)t[r].destroy(!0)}));var l=function(r){function n(){var e=null!==r&&r.apply(this,arguments)||this;return e.name="Sprite",e.sprites={},e}return i(n,r),n.prototype.init=function(){this.renderSystem=this.game.getSystem(t.RendererSystem),this.renderSystem.rendererManager.register(this)},n.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.sprites[e.id]&&(this.sprites[e.id].sprite.width=r,this.sprites[e.id].sprite.height=n)},n.prototype.componentChanged=function(t){return r=this,n=void 0,s=function(){var r,n,i,s,a;return o(this,(function(o){switch(o.label){case 0:return"Sprite"!==t.componentName?[3,5]:(r=t.gameObject.id,n=t.component,t.type!==e.OBSERVER_TYPE.ADD?[3,2]:(a=new p(null),this.sprites[t.gameObject.id]=a,this.containerManager.getContainer(t.gameObject.id).addChildAt(a.sprite,0),i=this.increaseAsyncId(r),[4,e.resource.getResource(n.resource)]));case 1:return s=o.sent().instance,this.validateAsyncId(r,i)?s?(a.image=s[n.resource+"_s|r|c_"+n.spriteName],[3,5]):(console.error("GameObject:"+t.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 2:return t.type!==e.OBSERVER_TYPE.CHANGE?[3,4]:(i=this.increaseAsyncId(r),[4,e.resource.getResource(n.resource)]);case 3:return s=o.sent().instance,this.validateAsyncId(r,i)?s?(this.sprites[t.gameObject.id].image=s[n.resource+"_s|r|c_"+n.spriteName],[3,5]):(console.error("GameObject:"+t.gameObject.name+"'s Sprite resource load error"),[2]):[2];case 4:t.type===e.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(r),a=this.sprites[t.gameObject.id],this.containerManager.getContainer(t.gameObject.id).removeChild(a.sprite),a.sprite.destroy({children:!0}),delete this.sprites[t.gameObject.id]),o.label=5;case 5:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(o,a)}c((s=s.apply(r,n||[])).next())}));var r,n,i,s},n.systemName="Sprite",n=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([e.decorators.componentObserver({Sprite:["spriteName"]})],n),n}(t.Renderer);exports.Sprite=c,exports.SpriteSystem=l;
@@ -1,5 +1,4 @@
1
1
  import { Component, resource, RESOURCE_TYPE, decorators, OBSERVER_TYPE } from '@eva/eva.js';
2
- import { Field } from '@eva/inspector-decorator';
3
2
  import { RendererSystem, Renderer } from '@eva/plugin-renderer';
4
3
  import { Texture, Sprite as Sprite$5, BaseTexture, Spritesheet } from 'pixi.js';
5
4
 
@@ -32,17 +31,6 @@ function __extends(d, b) {
32
31
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33
32
  }
34
33
 
35
- var __assign = function() {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
40
- }
41
- return t;
42
- };
43
- return __assign.apply(this, arguments);
44
- };
45
-
46
34
  function __decorate(decorators, target, key, desc) {
47
35
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
48
36
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -50,10 +38,6 @@ function __decorate(decorators, target, key, desc) {
50
38
  return c > 3 && r && Object.defineProperty(target, key, r), r;
51
39
  }
52
40
 
53
- function __metadata(metadataKey, metadataValue) {
54
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
55
- }
56
-
57
41
  function __awaiter(thisArg, _arguments, P, generator) {
58
42
  return new (P || (P = Promise))(function (resolve, reject) {
59
43
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -102,7 +86,6 @@ function __values(o) {
102
86
  };
103
87
  }
104
88
 
105
- var sleep = function (time) { return new Promise(function (resolve) { return setTimeout(resolve, time); }); };
106
89
  var Sprite$3 = (function (_super) {
107
90
  __extends(Sprite, _super);
108
91
  function Sprite() {
@@ -118,44 +101,6 @@ var Sprite$3 = (function (_super) {
118
101
  }
119
102
  };
120
103
  Sprite.componentName = 'Sprite';
121
- __decorate([
122
- Field({ type: 'resource' }),
123
- __metadata("design:type", String)
124
- ], Sprite.prototype, "resource", void 0);
125
- __decorate([
126
- Field({
127
- type: 'selector',
128
- options: function (instance) {
129
- var _a, _b, _c;
130
- return __awaiter(this, void 0, void 0, function () {
131
- var frames;
132
- return __generator(this, function (_d) {
133
- switch (_d.label) {
134
- case 0: return [4, sleep(0)];
135
- case 1:
136
- _d.sent();
137
- if (!instance.resource || !resource.promiseMap[instance.resource]) {
138
- return [2, {}];
139
- }
140
- return [4, resource.promiseMap[instance.resource]];
141
- case 2:
142
- _d.sent();
143
- frames = (_c = (_b = (_a = resource.resourcesMap[instance.resource]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.json) === null || _c === void 0 ? void 0 : _c.frames;
144
- return [2, frames
145
- ? Object.values(frames)
146
- .map(function (item) { return item.name; })
147
- .reduce(function (prev, key) {
148
- var _a;
149
- return (__assign(__assign({}, prev), (_a = {}, _a[key] = key, _a)));
150
- }, {})
151
- : {}];
152
- }
153
- });
154
- });
155
- },
156
- }),
157
- __metadata("design:type", String)
158
- ], Sprite.prototype, "spriteName", void 0);
159
104
  return Sprite;
160
105
  }(Component));
161
106
  var Sprite$4 = Sprite$3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-sprite",
3
- "version": "1.2.7-editor.10",
3
+ "version": "1.2.7-editor.11",
4
4
  "description": "@eva/plugin-renderer-sprite",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-sprite.esm.js",
@@ -18,9 +18,9 @@
18
18
  "license": "MIT",
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
- "@eva/inspector-decorator": "0.1.0-alpha.2",
22
- "@eva/plugin-renderer": "1.2.7-editor.10",
23
- "@eva/eva.js": "1.2.7-editor.10",
21
+ "@eva/inspector-decorator": "0.1.0-alpha.3",
22
+ "@eva/plugin-renderer": "1.2.7-editor.11",
23
+ "@eva/eva.js": "1.2.7-editor.11",
24
24
  "pixi.js": "^4.8.7"
25
25
  }
26
26
  }