@eva/plugin-renderer-img 1.2.6 → 1.2.7-editor.10
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.img.js +154 -34
- package/dist/EVA.plugin.renderer.img.min.js +1 -1
- package/dist/plugin-renderer-img.cjs.js +33 -21
- package/dist/plugin-renderer-img.cjs.prod.js +1 -1
- package/dist/plugin-renderer-img.esm.js +34 -22
- package/package.json +5 -5
- package/dist/miniprogram.js +0 -149
|
@@ -12,7 +12,7 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
12
12
|
d.__proto__ = b;
|
|
13
13
|
} || function (d, b) {
|
|
14
14
|
for (var p in b) {
|
|
15
|
-
if (
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -20,6 +20,8 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
function __extends(d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
24
|
+
|
|
23
25
|
_extendStatics(d, b);
|
|
24
26
|
|
|
25
27
|
function __() {
|
|
@@ -29,6 +31,22 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
29
31
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
32
|
}
|
|
31
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
|
+
|
|
32
50
|
function __decorate(decorators, target, key, desc) {
|
|
33
51
|
var c = arguments.length,
|
|
34
52
|
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
@@ -39,6 +57,10 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
39
57
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
40
58
|
}
|
|
41
59
|
|
|
60
|
+
function __metadata(metadataKey, metadataValue) {
|
|
61
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
62
|
+
}
|
|
63
|
+
|
|
42
64
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
43
65
|
function adopt(value) {
|
|
44
66
|
return value instanceof P ? value : new P(function (resolve) {
|
|
@@ -182,27 +204,117 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
182
204
|
}
|
|
183
205
|
}
|
|
184
206
|
|
|
185
|
-
function
|
|
186
|
-
|
|
187
|
-
|
|
207
|
+
var SymbolKeysNotSupportedError = function (_super) {
|
|
208
|
+
__extends(SymbolKeysNotSupportedError, _super);
|
|
209
|
+
|
|
210
|
+
function SymbolKeysNotSupportedError() {
|
|
211
|
+
var _newTarget = this.constructor;
|
|
212
|
+
|
|
213
|
+
var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
|
|
214
|
+
|
|
215
|
+
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
216
|
+
return _this;
|
|
188
217
|
}
|
|
189
218
|
|
|
190
|
-
|
|
191
|
-
|
|
219
|
+
return SymbolKeysNotSupportedError;
|
|
220
|
+
}(Error);
|
|
221
|
+
|
|
222
|
+
(function (_super) {
|
|
223
|
+
__extends(StaticGetPropertiesIsNotAFunctionError, _super);
|
|
224
|
+
|
|
225
|
+
function StaticGetPropertiesIsNotAFunctionError() {
|
|
226
|
+
var _newTarget = this.constructor;
|
|
227
|
+
|
|
228
|
+
var _this = _super.call(this, 'getProperties is not a function!') || this;
|
|
229
|
+
|
|
230
|
+
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
231
|
+
return _this;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return StaticGetPropertiesIsNotAFunctionError;
|
|
235
|
+
})(Error);
|
|
236
|
+
|
|
237
|
+
var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
|
|
238
|
+
|
|
239
|
+
function transformBasicType(type) {
|
|
240
|
+
if (type === String) {
|
|
241
|
+
return 'string';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (type === Number) {
|
|
245
|
+
return 'number';
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (type === Boolean) {
|
|
249
|
+
return 'boolean';
|
|
192
250
|
}
|
|
193
251
|
|
|
194
|
-
|
|
195
|
-
return propertyObj;
|
|
252
|
+
return 'unknown';
|
|
196
253
|
}
|
|
197
254
|
|
|
198
|
-
function
|
|
255
|
+
function defineTypes(target, key, options, returnTypeFunction) {
|
|
256
|
+
var type = Reflect.getMetadata('design:type', target, key);
|
|
257
|
+
var isArray = type === Array;
|
|
258
|
+
var str = transformBasicType(type);
|
|
259
|
+
|
|
260
|
+
if (str !== 'unknown') {
|
|
261
|
+
type = str;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (returnTypeFunction) {
|
|
265
|
+
var returnType = returnTypeFunction();
|
|
266
|
+
|
|
267
|
+
if (Array.isArray(returnType)) {
|
|
268
|
+
isArray = true;
|
|
269
|
+
type = returnType[0];
|
|
270
|
+
} else {
|
|
271
|
+
type = returnType;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
var properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
|
|
276
|
+
properties[key] = _assign({
|
|
277
|
+
type: type,
|
|
278
|
+
isArray: isArray
|
|
279
|
+
}, options);
|
|
280
|
+
Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
|
|
284
|
+
if (typeof returnTypeFuncOrOptions === 'function') {
|
|
285
|
+
return {
|
|
286
|
+
returnTypeFunc: returnTypeFuncOrOptions,
|
|
287
|
+
options: maybeOptions || {}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return {
|
|
292
|
+
options: returnTypeFuncOrOptions || {}
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function Field(returnTypeFunction, maybeOptions) {
|
|
199
297
|
return function (target, propertyKey) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
298
|
+
if (typeof propertyKey === 'symbol') {
|
|
299
|
+
throw new SymbolKeysNotSupportedError();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
|
|
303
|
+
options = _a.options,
|
|
304
|
+
returnTypeFunc = _a.returnTypeFunc;
|
|
305
|
+
|
|
306
|
+
defineTypes(target, propertyKey, options, returnTypeFunc);
|
|
203
307
|
};
|
|
204
308
|
}
|
|
205
309
|
|
|
310
|
+
var ExecuteMode;
|
|
311
|
+
|
|
312
|
+
(function (ExecuteMode) {
|
|
313
|
+
ExecuteMode[ExecuteMode["Edit"] = 2] = "Edit";
|
|
314
|
+
ExecuteMode[ExecuteMode["Game"] = 4] = "Game";
|
|
315
|
+
ExecuteMode[ExecuteMode["All"] = 6] = "All";
|
|
316
|
+
})(ExecuteMode || (ExecuteMode = {}));
|
|
317
|
+
|
|
206
318
|
var Img$2 = function (_super) {
|
|
207
319
|
__extends(Img, _super);
|
|
208
320
|
|
|
@@ -221,7 +333,9 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
221
333
|
|
|
222
334
|
Img.componentName = 'Img';
|
|
223
335
|
|
|
224
|
-
__decorate([
|
|
336
|
+
__decorate([Field({
|
|
337
|
+
type: 'resource'
|
|
338
|
+
}), __metadata("design:type", String)], Img.prototype, "resource", void 0);
|
|
225
339
|
|
|
226
340
|
return Img;
|
|
227
341
|
}(eva_js.Component);
|
|
@@ -278,43 +392,49 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
278
392
|
var _a, _b;
|
|
279
393
|
|
|
280
394
|
return __awaiter(this, void 0, void 0, function () {
|
|
281
|
-
var component,
|
|
395
|
+
var component, sprite, asyncId, instance, asyncId, instance, sprite;
|
|
282
396
|
return __generator(this, function (_c) {
|
|
283
397
|
switch (_c.label) {
|
|
284
398
|
case 0:
|
|
285
|
-
if (!(changed.componentName === 'Img')) return [3,
|
|
399
|
+
if (!(changed.componentName === 'Img')) return [3, 5];
|
|
286
400
|
component = changed.component;
|
|
287
|
-
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
401
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3, 2];
|
|
402
|
+
sprite = new rendererAdapter.Sprite(null);
|
|
403
|
+
this.imgs[changed.gameObject.id] = sprite;
|
|
404
|
+
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite.sprite, 0);
|
|
405
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
406
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
291
407
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
408
|
+
case 1:
|
|
409
|
+
instance = _c.sent().instance;
|
|
410
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return [2];
|
|
295
411
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite_1.sprite, 0);
|
|
300
|
-
return [3, 4];
|
|
412
|
+
if (!instance) {
|
|
413
|
+
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
414
|
+
}
|
|
301
415
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
return [4, eva_js.resource.getResource(component.resource)];
|
|
416
|
+
this.imgs[changed.gameObject.id].image = instance;
|
|
417
|
+
return [3, 5];
|
|
305
418
|
|
|
306
419
|
case 2:
|
|
420
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.CHANGE)) return [3, 4];
|
|
421
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
422
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
423
|
+
|
|
424
|
+
case 3:
|
|
307
425
|
instance = _c.sent().instance;
|
|
426
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId)) return [2];
|
|
308
427
|
|
|
309
428
|
if (!instance) {
|
|
310
429
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
311
430
|
}
|
|
312
431
|
|
|
313
432
|
this.imgs[changed.gameObject.id].image = instance;
|
|
314
|
-
return [3,
|
|
433
|
+
return [3, 5];
|
|
315
434
|
|
|
316
|
-
case
|
|
435
|
+
case 4:
|
|
317
436
|
if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
437
|
+
this.increaseAsyncId(changed.gameObject.id);
|
|
318
438
|
sprite = this.imgs[changed.gameObject.id];
|
|
319
439
|
if (!sprite) return [2];
|
|
320
440
|
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(changed.gameObject.id)) === null || _b === void 0 ? void 0 : _b.removeChild(sprite.sprite);
|
|
@@ -324,9 +444,9 @@ var _EVA_IIFE_img = function (exports, eva_js, pluginRenderer, rendererAdapter,
|
|
|
324
444
|
delete this.imgs[changed.gameObject.id];
|
|
325
445
|
}
|
|
326
446
|
|
|
327
|
-
_c.label =
|
|
447
|
+
_c.label = 5;
|
|
328
448
|
|
|
329
|
-
case
|
|
449
|
+
case 5:
|
|
330
450
|
return [2];
|
|
331
451
|
}
|
|
332
452
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_img=function(e,r,
|
|
1
|
+
window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_img=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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function c(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)}var a=function(){return a=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},a.apply(this,arguments)};function s(e,t,r,n){var o,i=arguments.length,c=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,r,c):o(t,r))||c);return i>3&&c&&Object.defineProperty(t,r,c),c}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){return new(r||(r=Promise))((function(o,i){function c(e){try{s(n.next(e))}catch(e){i(e)}}function a(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,a)}s((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,o,i,c={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(;c;)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 c.label++,{value:i[1],done:!1};case 5:c.label++,n=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}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])}}}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 c(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}c(t,e)}(Error);var d,g="IDE_PROPERTY_METADATA";function y(e,t,r,n){var o=Reflect.getMetadata("design:type",e,t),i=o===Array,c=function(e){return e===String?"string":e===Number?"number":e===Boolean?"boolean":"unknown"}(o);if("unknown"!==c&&(o=c),n){var s=n();Array.isArray(s)?(i=!0,o=s[0]):o=s}var u=Reflect.getMetadata(g,e.constructor)||{};u[t]=a({type:o,isArray:i},r),Reflect.defineMetadata(g,u,e.constructor)}!function(e){e[e.Edit=2]="Edit",e[e.Game=4]="Game",e[e.All=6]="All"}(d||(d={}));var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t}var r,n;return c(t,e),t.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource)},t.componentName="Img",s([(r={type:"resource"},function(e,t){if("symbol"==typeof t)throw new f;var o=function(e,t){return"function"==typeof e?{returnTypeFunc:e,options:t||{}}:{options:e||{}}}(r,n);y(e,t,o.options,o.returnTypeFunc)}),u("design:type",String)],t.prototype,"resource",void 0),t}(t.Component),h=m;t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,(function(e){var t=e.data,r=(void 0===t?{}:t).image;if(r)return o.Texture.from(r)})),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,(function(e){var t=e.instance;t&&t.destroy(!0)}));var b=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Img",t.imgs={},t}return c(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.imgs[e.id]&&(this.imgs[e.id].sprite.width=r,this.imgs[e.id].sprite.height=n)},o.prototype.componentChanged=function(e){var r,o;return l(this,void 0,void 0,(function(){var i,c,a,s;return p(this,(function(u){switch(u.label){case 0:return"Img"!==e.componentName?[3,5]:(i=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:(s=new n.Sprite(null),this.imgs[e.gameObject.id]=s,this.containerManager.getContainer(e.gameObject.id).addChildAt(s.sprite,0),c=this.increaseAsyncId(e.gameObject.id),[4,t.resource.getResource(i.resource)]));case 1:return a=u.sent().instance,this.validateAsyncId(e.gameObject.id,c)?(a||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.imgs[e.gameObject.id].image=a,[3,5]):[2];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,4]:(c=this.increaseAsyncId(e.gameObject.id),[4,t.resource.getResource(i.resource)]);case 3:return a=u.sent().instance,this.validateAsyncId(e.gameObject.id,c)?(a||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.imgs[e.gameObject.id].image=a,[3,5]):[2];case 4:if(e.type===t.OBSERVER_TYPE.REMOVE){if(this.increaseAsyncId(e.gameObject.id),!(s=this.imgs[e.gameObject.id]))return[2];null===(o=null===(r=this.containerManager)||void 0===r?void 0:r.getContainer(e.gameObject.id))||void 0===o||o.removeChild(s.sprite),s.sprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]}u.label=5;case 5:return[2]}}))}))},o.systemName="Img",o=s([t.decorators.componentObserver({Img:[{prop:["resource"],deep:!1}]})],o)}(r.Renderer),v=b;return e.Img=h,e.ImgSystem=v,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter,PIXI);window.EVA.plugin.renderer.img=window.EVA.plugin.renderer.img||_EVA_IIFE_img;
|
|
@@ -44,6 +44,10 @@ function __decorate(decorators, target, key, desc) {
|
|
|
44
44
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function __metadata(metadataKey, metadataValue) {
|
|
48
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
48
52
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
49
53
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -95,7 +99,8 @@ var Img$2 = (function (_super) {
|
|
|
95
99
|
};
|
|
96
100
|
Img.componentName = 'Img';
|
|
97
101
|
__decorate([
|
|
98
|
-
inspectorDecorator.type
|
|
102
|
+
inspectorDecorator.Field({ type: 'resource' }),
|
|
103
|
+
__metadata("design:type", String)
|
|
99
104
|
], Img.prototype, "resource", void 0);
|
|
100
105
|
return Img;
|
|
101
106
|
}(eva_js.Component));
|
|
@@ -138,36 +143,43 @@ var Img = (function (_super) {
|
|
|
138
143
|
Img.prototype.componentChanged = function (changed) {
|
|
139
144
|
var _a, _b;
|
|
140
145
|
return __awaiter(this, void 0, void 0, function () {
|
|
141
|
-
var component,
|
|
146
|
+
var component, sprite, asyncId, instance, asyncId, instance, sprite;
|
|
142
147
|
return __generator(this, function (_c) {
|
|
143
148
|
switch (_c.label) {
|
|
144
149
|
case 0:
|
|
145
|
-
if (!(changed.componentName === 'Img')) return [3,
|
|
150
|
+
if (!(changed.componentName === 'Img')) return [3, 5];
|
|
146
151
|
component = changed.component;
|
|
147
|
-
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
153
|
-
}
|
|
154
|
-
sprite_1.image = instance;
|
|
155
|
-
});
|
|
156
|
-
this.imgs[changed.gameObject.id] = sprite_1;
|
|
157
|
-
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite_1.sprite, 0);
|
|
158
|
-
return [3, 4];
|
|
159
|
-
case 1:
|
|
160
|
-
if (!(changed.type === eva_js.OBSERVER_TYPE.CHANGE)) return [3, 3];
|
|
152
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.ADD)) return [3, 2];
|
|
153
|
+
sprite = new rendererAdapter.Sprite(null);
|
|
154
|
+
this.imgs[changed.gameObject.id] = sprite;
|
|
155
|
+
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite.sprite, 0);
|
|
156
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
161
157
|
return [4, eva_js.resource.getResource(component.resource)];
|
|
162
|
-
case
|
|
158
|
+
case 1:
|
|
163
159
|
instance = (_c.sent()).instance;
|
|
160
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId))
|
|
161
|
+
return [2];
|
|
164
162
|
if (!instance) {
|
|
165
163
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
166
164
|
}
|
|
167
165
|
this.imgs[changed.gameObject.id].image = instance;
|
|
168
|
-
return [3,
|
|
166
|
+
return [3, 5];
|
|
167
|
+
case 2:
|
|
168
|
+
if (!(changed.type === eva_js.OBSERVER_TYPE.CHANGE)) return [3, 4];
|
|
169
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
170
|
+
return [4, eva_js.resource.getResource(component.resource)];
|
|
169
171
|
case 3:
|
|
172
|
+
instance = (_c.sent()).instance;
|
|
173
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId))
|
|
174
|
+
return [2];
|
|
175
|
+
if (!instance) {
|
|
176
|
+
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
177
|
+
}
|
|
178
|
+
this.imgs[changed.gameObject.id].image = instance;
|
|
179
|
+
return [3, 5];
|
|
180
|
+
case 4:
|
|
170
181
|
if (changed.type === eva_js.OBSERVER_TYPE.REMOVE) {
|
|
182
|
+
this.increaseAsyncId(changed.gameObject.id);
|
|
171
183
|
sprite = this.imgs[changed.gameObject.id];
|
|
172
184
|
if (!sprite)
|
|
173
185
|
return [2];
|
|
@@ -175,8 +187,8 @@ var Img = (function (_super) {
|
|
|
175
187
|
sprite.sprite.destroy({ children: true });
|
|
176
188
|
delete this.imgs[changed.gameObject.id];
|
|
177
189
|
}
|
|
178
|
-
_c.label =
|
|
179
|
-
case
|
|
190
|
+
_c.label = 5;
|
|
191
|
+
case 5: return [2];
|
|
180
192
|
}
|
|
181
193
|
});
|
|
182
194
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/inspector-decorator"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/inspector-decorator"),t=require("@eva/eva.js"),r=require("@eva/plugin-renderer"),n=require("@eva/renderer-adapter"),i=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])},o(e,t)};function c(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 i,o=arguments.length,c=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t){var r,n,i,o,c={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(;c;)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 c.label++,{value:o[1],done:!1};case 5:c.label++,n=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(i=c.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}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])}}}var l=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.resource="",e}return c(r,t),r.prototype.init=function(e){e&&e.resource&&(this.resource=e.resource)},r.componentName="Img",a([e.Field({type:"resource"}),s("design:type",String)],r.prototype,"resource",void 0),r}(t.Component),p=l;t.resource.registerInstance(t.RESOURCE_TYPE.IMAGE,(function(e){var t=e.data,r=(void 0===t?{}:t).image;if(r)return i.Texture.from(r)})),t.resource.registerDestroy(t.RESOURCE_TYPE.IMAGE,(function(e){var t=e.instance;t&&t.destroy(!0)}));var d=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="Img",t.imgs={},t}return c(i,e),i.prototype.init=function(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)},i.prototype.rendererUpdate=function(e){var t=e.transform.size,r=t.width,n=t.height;this.imgs[e.id]&&(this.imgs[e.id].sprite.width=r,this.imgs[e.id].sprite.height=n)},i.prototype.componentChanged=function(e){var r,i,o,c,a,s;return o=this,c=void 0,s=function(){var o,c,a,s;return u(this,(function(u){switch(u.label){case 0:return"Img"!==e.componentName?[3,5]:(o=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:(s=new n.Sprite(null),this.imgs[e.gameObject.id]=s,this.containerManager.getContainer(e.gameObject.id).addChildAt(s.sprite,0),c=this.increaseAsyncId(e.gameObject.id),[4,t.resource.getResource(o.resource)]));case 1:return a=u.sent().instance,this.validateAsyncId(e.gameObject.id,c)?(a||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.imgs[e.gameObject.id].image=a,[3,5]):[2];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,4]:(c=this.increaseAsyncId(e.gameObject.id),[4,t.resource.getResource(o.resource)]);case 3:return a=u.sent().instance,this.validateAsyncId(e.gameObject.id,c)?(a||console.error("GameObject:"+e.gameObject.name+"'s Img resource load error"),this.imgs[e.gameObject.id].image=a,[3,5]):[2];case 4:if(e.type===t.OBSERVER_TYPE.REMOVE){if(this.increaseAsyncId(e.gameObject.id),!(s=this.imgs[e.gameObject.id]))return[2];null===(i=null===(r=this.containerManager)||void 0===r?void 0:r.getContainer(e.gameObject.id))||void 0===i||i.removeChild(s.sprite),s.sprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]}u.label=5;case 5:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{i(s.next(e))}catch(e){t(e)}}function n(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(r,n)}i((s=s.apply(o,c||[])).next())}))},i.systemName="Img",i=a([t.decorators.componentObserver({Img:[{prop:["resource"],deep:!1}]})],i)}(r.Renderer);exports.Img=p,exports.ImgSystem=d;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Field } from '@eva/inspector-decorator';
|
|
2
2
|
import { Component, resource, RESOURCE_TYPE, decorators, OBSERVER_TYPE } from '@eva/eva.js';
|
|
3
3
|
import { RendererSystem, Renderer } from '@eva/plugin-renderer';
|
|
4
4
|
import { Sprite } from '@eva/renderer-adapter';
|
|
@@ -40,6 +40,10 @@ function __decorate(decorators, target, key, desc) {
|
|
|
40
40
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function __metadata(metadataKey, metadataValue) {
|
|
44
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
44
48
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
45
49
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -91,7 +95,8 @@ var Img$2 = (function (_super) {
|
|
|
91
95
|
};
|
|
92
96
|
Img.componentName = 'Img';
|
|
93
97
|
__decorate([
|
|
94
|
-
type
|
|
98
|
+
Field({ type: 'resource' }),
|
|
99
|
+
__metadata("design:type", String)
|
|
95
100
|
], Img.prototype, "resource", void 0);
|
|
96
101
|
return Img;
|
|
97
102
|
}(Component));
|
|
@@ -134,36 +139,43 @@ var Img = (function (_super) {
|
|
|
134
139
|
Img.prototype.componentChanged = function (changed) {
|
|
135
140
|
var _a, _b;
|
|
136
141
|
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
-
var component,
|
|
142
|
+
var component, sprite, asyncId, instance, asyncId, instance, sprite;
|
|
138
143
|
return __generator(this, function (_c) {
|
|
139
144
|
switch (_c.label) {
|
|
140
145
|
case 0:
|
|
141
|
-
if (!(changed.componentName === 'Img')) return [3,
|
|
146
|
+
if (!(changed.componentName === 'Img')) return [3, 5];
|
|
142
147
|
component = changed.component;
|
|
143
|
-
if (!(changed.type === OBSERVER_TYPE.ADD)) return [3,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
149
|
-
}
|
|
150
|
-
sprite_1.image = instance;
|
|
151
|
-
});
|
|
152
|
-
this.imgs[changed.gameObject.id] = sprite_1;
|
|
153
|
-
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite_1.sprite, 0);
|
|
154
|
-
return [3, 4];
|
|
155
|
-
case 1:
|
|
156
|
-
if (!(changed.type === OBSERVER_TYPE.CHANGE)) return [3, 3];
|
|
148
|
+
if (!(changed.type === OBSERVER_TYPE.ADD)) return [3, 2];
|
|
149
|
+
sprite = new Sprite(null);
|
|
150
|
+
this.imgs[changed.gameObject.id] = sprite;
|
|
151
|
+
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite.sprite, 0);
|
|
152
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
157
153
|
return [4, resource.getResource(component.resource)];
|
|
158
|
-
case
|
|
154
|
+
case 1:
|
|
159
155
|
instance = (_c.sent()).instance;
|
|
156
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId))
|
|
157
|
+
return [2];
|
|
160
158
|
if (!instance) {
|
|
161
159
|
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
162
160
|
}
|
|
163
161
|
this.imgs[changed.gameObject.id].image = instance;
|
|
164
|
-
return [3,
|
|
162
|
+
return [3, 5];
|
|
163
|
+
case 2:
|
|
164
|
+
if (!(changed.type === OBSERVER_TYPE.CHANGE)) return [3, 4];
|
|
165
|
+
asyncId = this.increaseAsyncId(changed.gameObject.id);
|
|
166
|
+
return [4, resource.getResource(component.resource)];
|
|
165
167
|
case 3:
|
|
168
|
+
instance = (_c.sent()).instance;
|
|
169
|
+
if (!this.validateAsyncId(changed.gameObject.id, asyncId))
|
|
170
|
+
return [2];
|
|
171
|
+
if (!instance) {
|
|
172
|
+
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
173
|
+
}
|
|
174
|
+
this.imgs[changed.gameObject.id].image = instance;
|
|
175
|
+
return [3, 5];
|
|
176
|
+
case 4:
|
|
166
177
|
if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
178
|
+
this.increaseAsyncId(changed.gameObject.id);
|
|
167
179
|
sprite = this.imgs[changed.gameObject.id];
|
|
168
180
|
if (!sprite)
|
|
169
181
|
return [2];
|
|
@@ -171,8 +183,8 @@ var Img = (function (_super) {
|
|
|
171
183
|
sprite.sprite.destroy({ children: true });
|
|
172
184
|
delete this.imgs[changed.gameObject.id];
|
|
173
185
|
}
|
|
174
|
-
_c.label =
|
|
175
|
-
case
|
|
186
|
+
_c.label = 5;
|
|
187
|
+
case 5: return [2];
|
|
176
188
|
}
|
|
177
189
|
});
|
|
178
190
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-img",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7-editor.10",
|
|
4
4
|
"description": "@eva/plugin-renderer-img",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-img.esm.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eva/inspector-decorator": "
|
|
22
|
-
"@eva/plugin-renderer": "1.2.
|
|
23
|
-
"@eva/renderer-adapter": "1.2.
|
|
24
|
-
"@eva/eva.js": "1.2.
|
|
21
|
+
"@eva/inspector-decorator": "0.1.0-alpha.2",
|
|
22
|
+
"@eva/plugin-renderer": "1.2.7-editor.10",
|
|
23
|
+
"@eva/renderer-adapter": "1.2.7-editor.10",
|
|
24
|
+
"@eva/eva.js": "1.2.7-editor.10",
|
|
25
25
|
"pixi.js": "^4.8.7"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/dist/miniprogram.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { __extends, __decorate, __awaiter, __generator } from 'tslib';
|
|
2
|
-
import { type } from '@eva/inspector-decorator';
|
|
3
|
-
import { Component, resource, RESOURCE_TYPE, OBSERVER_TYPE, decorators } from '@eva/eva.js/dist/miniprogram';
|
|
4
|
-
import { RendererSystem, Renderer } from '@eva/plugin-renderer/dist/miniprogram';
|
|
5
|
-
import { Sprite } from '@eva/renderer-adapter/dist/miniprogram';
|
|
6
|
-
import { Texture } from '@eva/miniprogram-pixi';
|
|
7
|
-
|
|
8
|
-
var Img$2 = function (_super) {
|
|
9
|
-
__extends(Img, _super);
|
|
10
|
-
|
|
11
|
-
function Img() {
|
|
12
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
-
|
|
14
|
-
_this.resource = '';
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Img.prototype.init = function (obj) {
|
|
19
|
-
if (obj && obj.resource) {
|
|
20
|
-
this.resource = obj.resource;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
Img.componentName = 'Img';
|
|
25
|
-
|
|
26
|
-
__decorate([type('string')], Img.prototype, "resource", void 0);
|
|
27
|
-
|
|
28
|
-
return Img;
|
|
29
|
-
}(Component);
|
|
30
|
-
|
|
31
|
-
var Img$3 = Img$2;
|
|
32
|
-
resource.registerInstance(RESOURCE_TYPE.IMAGE, function (_a) {
|
|
33
|
-
var _b = _a.data,
|
|
34
|
-
data = _b === void 0 ? {} : _b;
|
|
35
|
-
var image = data.image;
|
|
36
|
-
|
|
37
|
-
if (image) {
|
|
38
|
-
var texture = Texture.from(image);
|
|
39
|
-
return texture;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return;
|
|
43
|
-
});
|
|
44
|
-
resource.registerDestroy(RESOURCE_TYPE.IMAGE, function (_a) {
|
|
45
|
-
var instance = _a.instance;
|
|
46
|
-
|
|
47
|
-
if (instance) {
|
|
48
|
-
instance.destroy(true);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var Img = function (_super) {
|
|
53
|
-
__extends(Img, _super);
|
|
54
|
-
|
|
55
|
-
function Img() {
|
|
56
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
-
|
|
58
|
-
_this.name = 'Img';
|
|
59
|
-
_this.imgs = {};
|
|
60
|
-
return _this;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
Img.prototype.init = function () {
|
|
64
|
-
this.renderSystem = this.game.getSystem(RendererSystem);
|
|
65
|
-
this.renderSystem.rendererManager.register(this);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
Img.prototype.rendererUpdate = function (gameObject) {
|
|
69
|
-
var _a = gameObject.transform.size,
|
|
70
|
-
width = _a.width,
|
|
71
|
-
height = _a.height;
|
|
72
|
-
|
|
73
|
-
if (this.imgs[gameObject.id]) {
|
|
74
|
-
this.imgs[gameObject.id].sprite.width = width;
|
|
75
|
-
this.imgs[gameObject.id].sprite.height = height;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
Img.prototype.componentChanged = function (changed) {
|
|
80
|
-
var _a, _b;
|
|
81
|
-
|
|
82
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
var component, sprite_1, instance, sprite;
|
|
84
|
-
return __generator(this, function (_c) {
|
|
85
|
-
switch (_c.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
if (!(changed.componentName === 'Img')) return [3, 4];
|
|
88
|
-
component = changed.component;
|
|
89
|
-
if (!(changed.type === OBSERVER_TYPE.ADD)) return [3, 1];
|
|
90
|
-
sprite_1 = new Sprite(null);
|
|
91
|
-
resource.getResource(component.resource).then(function (_a) {
|
|
92
|
-
var instance = _a.instance;
|
|
93
|
-
|
|
94
|
-
if (!instance) {
|
|
95
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
sprite_1.image = instance;
|
|
99
|
-
});
|
|
100
|
-
this.imgs[changed.gameObject.id] = sprite_1;
|
|
101
|
-
this.containerManager.getContainer(changed.gameObject.id).addChildAt(sprite_1.sprite, 0);
|
|
102
|
-
return [3, 4];
|
|
103
|
-
|
|
104
|
-
case 1:
|
|
105
|
-
if (!(changed.type === OBSERVER_TYPE.CHANGE)) return [3, 3];
|
|
106
|
-
return [4, resource.getResource(component.resource)];
|
|
107
|
-
|
|
108
|
-
case 2:
|
|
109
|
-
instance = _c.sent().instance;
|
|
110
|
-
|
|
111
|
-
if (!instance) {
|
|
112
|
-
console.error("GameObject:" + changed.gameObject.name + "'s Img resource load error");
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.imgs[changed.gameObject.id].image = instance;
|
|
116
|
-
return [3, 4];
|
|
117
|
-
|
|
118
|
-
case 3:
|
|
119
|
-
if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
120
|
-
sprite = this.imgs[changed.gameObject.id];
|
|
121
|
-
if (!sprite) return [2];
|
|
122
|
-
(_b = (_a = this.containerManager) === null || _a === void 0 ? void 0 : _a.getContainer(changed.gameObject.id)) === null || _b === void 0 ? void 0 : _b.removeChild(sprite.sprite);
|
|
123
|
-
sprite.sprite.destroy({
|
|
124
|
-
children: true
|
|
125
|
-
});
|
|
126
|
-
delete this.imgs[changed.gameObject.id];
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
_c.label = 4;
|
|
130
|
-
|
|
131
|
-
case 4:
|
|
132
|
-
return [2];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
Img.systemName = 'Img';
|
|
139
|
-
Img = __decorate([decorators.componentObserver({
|
|
140
|
-
Img: [{
|
|
141
|
-
prop: ['resource'],
|
|
142
|
-
deep: false
|
|
143
|
-
}]
|
|
144
|
-
})], Img);
|
|
145
|
-
return Img;
|
|
146
|
-
}(Renderer);
|
|
147
|
-
|
|
148
|
-
var Img$1 = Img;
|
|
149
|
-
export { Img$3 as Img, Img$1 as ImgSystem };
|