@eva/plugin-renderer-tiling-sprite 2.0.0-beta.9 → 2.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- window.EVA = window.EVA || {};
2
- window.EVA.plugin = window.EVA.plugin || {};
3
- window.EVA.plugin.renderer = window.EVA.plugin.renderer || {};
1
+ globalThis.EVA = globalThis.EVA || {};
2
+ globalThis.EVA.plugin = globalThis.EVA.plugin || {};
3
+ globalThis.EVA.plugin.renderer = globalThis.EVA.plugin.renderer || {};
4
4
  var _EVA_IIFE_tilingSprite = function (exports, eva_js, pluginRenderer, rendererAdapter) {
5
5
  'use strict';
6
6
  function __decorate(decorators, target, key, desc) {
@@ -178,4 +178,4 @@ var _EVA_IIFE_tilingSprite = function (exports, eva_js, pluginRenderer, renderer
178
178
  });
179
179
  return exports;
180
180
  }({}, EVA, EVA.plugin.renderer, EVA.rendererAdapter);
181
- window.EVA.plugin.renderer.tilingSprite = window.EVA.plugin.renderer.tilingSprite || _EVA_IIFE_tilingSprite;
181
+ globalThis.EVA.plugin.renderer.tilingSprite = globalThis.EVA.plugin.renderer.tilingSprite || _EVA_IIFE_tilingSprite;
@@ -1 +1 @@
1
- window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_tilingSprite=function(e,t,i,r){"use strict";function n(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function o(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function c(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,c)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){return e.constructor.IDEProps||(e.constructor.IDEProps={}),e.constructor.IDEProps[t]||(e.constructor.IDEProps[t]={}),e.constructor.IDEProps[t]}function c(e){return function(t,i){var r=s(t,i);r.key=i,r.type=e}}function l(e){return function(t,i){s(t,i).step=e}}class p extends t.Component{constructor(){super(...arguments),this.resource="",this.tileScale={x:1,y:1},this.tilePosition={x:0,y:0}}init(e){e&&(this.resource=e.resource,this.tileScale=e.tileScale,this.tilePosition=e.tilePosition)}}p.componentName="TilingSprite",n([c("string")],p.prototype,"resource",void 0),n([c("vector2"),l(.1)],p.prototype,"tileScale",void 0),n([c("vector2"),l(1)],p.prototype,"tilePosition",void 0);let a=class extends i.Renderer{constructor(){super(...arguments),this.name="TilingSprite",this.imgs={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size,r=this.imgs[e.id];r&&(r.tilingSprite.width=t,r.tilingSprite.height=i)}componentChanged(e){return o(this,void 0,void 0,(function*(){const i=e.gameObject.id;if("TilingSprite"===e.componentName){const n=e.component;if(e.type===t.OBSERVER_TYPE.ADD){const o=new r.TilingSprite(null);this.imgs[e.gameObject.id]=o,this.containerManager.getContainer(e.gameObject.id).addChildAt(o.tilingSprite,0),this.setProp(e.gameObject.id,n);const s=this.increaseAsyncId(i),{data:c}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,s))return;if(!c)return void console.error(`GameObject:${e.gameObject.name}'s TilingSprite resource load error`);o.image=c.image}else if(e.type===t.OBSERVER_TYPE.CHANGE)if("resource"===e.prop.prop[0]){const r=this.increaseAsyncId(i),{data:o}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,r))return;if(!o)return void console.error(`GameObject:${e.gameObject.name}'s TilingSprite resource load error`);this.imgs[e.gameObject.id].image=o.image}else this.setProp(e.gameObject.id,n);else if(e.type===t.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const t=this.imgs[e.gameObject.id];this.containerManager.getContainer(e.gameObject.id).removeChild(t.tilingSprite),t.tilingSprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]}}}))}setProp(e,t){this.imgs[e].tilingSprite.tilePosition=t.tilePosition,this.imgs[e].tilingSprite.tileScale=t.tileScale}};a=n([t.decorators.componentObserver({TilingSprite:[{prop:["resource"],deep:!1},{prop:["tileScale"],deep:!0},{prop:["tilePosition"],deep:!0}]})],a);var d=a;return e.TilingSprite=p,e.TilingSpriteSystem=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter);window.EVA.plugin.renderer.tilingSprite=window.EVA.plugin.renderer.tilingSprite||_EVA_IIFE_tilingSprite;
1
+ globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{},globalThis.EVA.plugin.renderer=globalThis.EVA.plugin.renderer||{};var _EVA_IIFE_tilingSprite=function(e,t,i,r){"use strict";function n(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function o(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function c(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,c)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){return e.constructor.IDEProps||(e.constructor.IDEProps={}),e.constructor.IDEProps[t]||(e.constructor.IDEProps[t]={}),e.constructor.IDEProps[t]}function c(e){return function(t,i){var r=s(t,i);r.key=i,r.type=e}}function l(e){return function(t,i){s(t,i).step=e}}class a extends t.Component{constructor(){super(...arguments),this.resource="",this.tileScale={x:1,y:1},this.tilePosition={x:0,y:0}}init(e){e&&(this.resource=e.resource,this.tileScale=e.tileScale,this.tilePosition=e.tilePosition)}}a.componentName="TilingSprite",n([c("string")],a.prototype,"resource",void 0),n([c("vector2"),l(.1)],a.prototype,"tileScale",void 0),n([c("vector2"),l(1)],a.prototype,"tilePosition",void 0);let p=class extends i.Renderer{constructor(){super(...arguments),this.name="TilingSprite",this.imgs={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size,r=this.imgs[e.id];r&&(r.tilingSprite.width=t,r.tilingSprite.height=i)}componentChanged(e){return o(this,void 0,void 0,(function*(){const i=e.gameObject.id;if("TilingSprite"===e.componentName){const n=e.component;if(e.type===t.OBSERVER_TYPE.ADD){const o=new r.TilingSprite(null);this.imgs[e.gameObject.id]=o,this.containerManager.getContainer(e.gameObject.id).addChildAt(o.tilingSprite,0),this.setProp(e.gameObject.id,n);const s=this.increaseAsyncId(i),{data:c}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,s))return;if(!c)return void console.error(`GameObject:${e.gameObject.name}'s TilingSprite resource load error`);o.image=c.image}else if(e.type===t.OBSERVER_TYPE.CHANGE)if("resource"===e.prop.prop[0]){const r=this.increaseAsyncId(i),{data:o}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,r))return;if(!o)return void console.error(`GameObject:${e.gameObject.name}'s TilingSprite resource load error`);this.imgs[e.gameObject.id].image=o.image}else this.setProp(e.gameObject.id,n);else if(e.type===t.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const t=this.imgs[e.gameObject.id];this.containerManager.getContainer(e.gameObject.id).removeChild(t.tilingSprite),t.tilingSprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]}}}))}setProp(e,t){this.imgs[e].tilingSprite.tilePosition=t.tilePosition,this.imgs[e].tilingSprite.tileScale=t.tileScale}};p=n([t.decorators.componentObserver({TilingSprite:[{prop:["resource"],deep:!1},{prop:["tileScale"],deep:!0},{prop:["tilePosition"],deep:!0}]})],p);var g=p;return e.TilingSprite=a,e.TilingSpriteSystem=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter);globalThis.EVA.plugin.renderer.tilingSprite=globalThis.EVA.plugin.renderer.tilingSprite||_EVA_IIFE_tilingSprite;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-tiling-sprite",
3
- "version": "2.0.0-beta.9",
3
+ "version": "2.0.1-beta.0",
4
4
  "description": "@eva/plugin-renderer-tiling-sprite",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-tiling-sprite.esm.js",
@@ -19,8 +19,8 @@
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
21
  "@eva/inspector-decorator": "^0.0.5",
22
- "@eva/plugin-renderer": "2.0.0-beta.9",
23
- "@eva/renderer-adapter": "2.0.0-beta.9",
24
- "@eva/eva.js": "2.0.0-beta.9"
22
+ "@eva/plugin-renderer": "2.0.1-beta.0",
23
+ "@eva/renderer-adapter": "2.0.1-beta.0",
24
+ "@eva/eva.js": "2.0.1-beta.0"
25
25
  }
26
26
  }