@eva/plugin-renderer-tiling-sprite 1.2.4 → 1.2.6

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 +1 @@
1
- var _EVA_IIFE_tilingSprite=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)t.hasOwnProperty(r)&&(e[r]=t[r])})(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)}function c(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 s=e.length-1;s>=0;s--)(i=e[s])&&(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,r,n){return new(r||(r=Promise))((function(i,o){function c(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,s)}a((n=n.apply(e,t||[])).next())}))}function a(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){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,s])}}}function l(e,t){return e.constructor.IDEProps||(e.constructor.IDEProps={}),e.constructor.IDEProps[t]||(e.constructor.IDEProps[t]={}),e.constructor.IDEProps[t]}function u(e){return function(t,r){var n=l(t,r);n.key=r,n.type=e}}function p(e){return function(t,r){l(t,r).step=e}}var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.tileScale={x:1,y:1},t.tilePosition={x:0,y:0},t}return o(t,e),t.prototype.init=function(e){e&&(this.resource=e.resource,this.tileScale=e.tileScale,this.tilePosition=e.tilePosition)},t.componentName="TilingSprite",c([u("string")],t.prototype,"resource",void 0),c([u("vector2"),p(.1)],t.prototype,"tileScale",void 0),c([u("vector2"),p(1)],t.prototype,"tilePosition",void 0),t}(t.Component),g=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="TilingSprite",t.imgs={},t}return o(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,i=this.imgs[e.id];i&&(i.tilingSprite.width=r,i.tilingSprite.height=n)},i.prototype.componentChanged=function(e){return s(this,void 0,void 0,(function(){var r,i,o,c;return a(this,(function(s){switch(s.label){case 0:return"TilingSprite"!==e.componentName?[3,6]:(r=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,1]:(i=new n.TilingSprite(null),t.resource.getResource(r.resource).then((function(t){var r=t.data;r?i.image=r.image:console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error")})),this.imgs[e.gameObject.id]=i,this.containerManager.getContainer(e.gameObject.id).addChildAt(i.tilingSprite,0),this.setProp(e.gameObject.id,r),[3,6]));case 1:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,5]:"resource"!==e.prop.prop[0]?[3,3]:[4,t.resource.getResource(r.resource)];case 2:return(o=s.sent().data)?(this.imgs[e.gameObject.id].image=o.image,[3,4]):(console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error"),[2]);case 3:this.setProp(e.gameObject.id,r),s.label=4;case 4:return[3,6];case 5:e.type===t.OBSERVER_TYPE.REMOVE&&(c=this.imgs[e.gameObject.id],this.containerManager.getContainer(e.gameObject.id).removeChild(c.tilingSprite),c.tilingSprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]),s.label=6;case 6:return[2]}}))}))},i.prototype.setProp=function(e,t){this.imgs[e].tilingSprite.tilePosition=t.tilePosition,this.imgs[e].tilingSprite.tileScale=t.tileScale},i=c([t.decorators.componentObserver({TilingSprite:[{prop:["resource"],deep:!1},{prop:["tileScale"],deep:!0},{prop:["tilePosition"],deep:!0}]})],i)}(r.Renderer);return e.TilingSprite=f,e.TilingSpriteSystem=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter);
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,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)t.hasOwnProperty(r)&&(e[r]=t[r])})(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)}function c(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 s=e.length-1;s>=0;s--)(i=e[s])&&(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,r,n){return new(r||(r=Promise))((function(i,o){function c(e){try{a(n.next(e))}catch(e){o(e)}}function s(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,s)}a((n=n.apply(e,t||[])).next())}))}function a(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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){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,s])}}}function l(e,t){return e.constructor.IDEProps||(e.constructor.IDEProps={}),e.constructor.IDEProps[t]||(e.constructor.IDEProps[t]={}),e.constructor.IDEProps[t]}function p(e){return function(t,r){var n=l(t,r);n.key=r,n.type=e}}function u(e){return function(t,r){l(t,r).step=e}}var g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resource="",t.tileScale={x:1,y:1},t.tilePosition={x:0,y:0},t}return o(t,e),t.prototype.init=function(e){e&&(this.resource=e.resource,this.tileScale=e.tileScale,this.tilePosition=e.tilePosition)},t.componentName="TilingSprite",c([p("string")],t.prototype,"resource",void 0),c([p("vector2"),u(.1)],t.prototype,"tileScale",void 0),c([p("vector2"),u(1)],t.prototype,"tilePosition",void 0),t}(t.Component),d=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="TilingSprite",t.imgs={},t}return o(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,i=this.imgs[e.id];i&&(i.tilingSprite.width=r,i.tilingSprite.height=n)},i.prototype.componentChanged=function(e){return s(this,void 0,void 0,(function(){var r,i,o,c;return a(this,(function(s){switch(s.label){case 0:return"TilingSprite"!==e.componentName?[3,6]:(r=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,1]:(i=new n.TilingSprite(null),t.resource.getResource(r.resource).then((function(t){var r=t.data;r?i.image=r.image:console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error")})),this.imgs[e.gameObject.id]=i,this.containerManager.getContainer(e.gameObject.id).addChildAt(i.tilingSprite,0),this.setProp(e.gameObject.id,r),[3,6]));case 1:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,5]:"resource"!==e.prop.prop[0]?[3,3]:[4,t.resource.getResource(r.resource)];case 2:return(o=s.sent().data)?(this.imgs[e.gameObject.id].image=o.image,[3,4]):(console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error"),[2]);case 3:this.setProp(e.gameObject.id,r),s.label=4;case 4:return[3,6];case 5:e.type===t.OBSERVER_TYPE.REMOVE&&(c=this.imgs[e.gameObject.id],this.containerManager.getContainer(e.gameObject.id).removeChild(c.tilingSprite),c.tilingSprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]),s.label=6;case 6:return[2]}}))}))},i.prototype.setProp=function(e,t){this.imgs[e].tilingSprite.tilePosition=t.tilePosition,this.imgs[e].tilingSprite.tileScale=t.tileScale},i=c([t.decorators.componentObserver({TilingSprite:[{prop:["resource"],deep:!1},{prop:["tileScale"],deep:!0},{prop:["tilePosition"],deep:!0}]})],i)}(r.Renderer);return e.TilingSprite=g,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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-tiling-sprite",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "@eva/plugin-renderer-tiling-sprite",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-tiling-sprite.esm.js",
@@ -19,9 +19,9 @@
19
19
  "homepage": "https://eva.js.org",
20
20
  "dependencies": {
21
21
  "@eva/inspector-decorator": "^0.0.5",
22
- "@eva/plugin-renderer": "1.2.4",
23
- "@eva/renderer-adapter": "1.2.4",
24
- "@eva/eva.js": "1.2.4",
22
+ "@eva/plugin-renderer": "1.2.6",
23
+ "@eva/renderer-adapter": "1.2.6",
24
+ "@eva/eva.js": "1.2.6",
25
25
  "@types/pixi.js": "^4.8.9"
26
26
  }
27
27
  }