@eva/plugin-renderer-mesh 2.0.0-beta.18 → 2.0.0-beta.19

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_mesh = function (exports, eva_js, pluginRenderer, pixi_js) {
5
5
  'use strict';
6
6
 
@@ -154,4 +154,4 @@ var _EVA_IIFE_mesh = function (exports, eva_js, pluginRenderer, pixi_js) {
154
154
  });
155
155
  return exports;
156
156
  }({}, EVA, EVA.plugin.renderer, PIXI);
157
- window.EVA.plugin.renderer.mesh = window.EVA.plugin.renderer.mesh || _EVA_IIFE_mesh;
157
+ globalThis.EVA.plugin.renderer.mesh = globalThis.EVA.plugin.renderer.mesh || _EVA_IIFE_mesh;
@@ -1 +1 @@
1
- window.EVA=window.EVA||{},window.EVA.plugin=window.EVA.plugin||{},window.EVA.plugin.renderer=window.EVA.plugin.renderer||{};var _EVA_IIFE_mesh=function(e,r,t,s){"use strict";class n extends r.Component{constructor(){super(...arguments),this.verticesX=10,this.verticesY=10,this._forceUpdate=0}init(e){e&&e.resource&&(this.resource=e.resource),e&&e.verticesX&&(this.verticesX=e.verticesX),e&&e.verticesY&&(this.verticesY=e.verticesY)}setCorners(e,r,t,s,n,i,o,c){const d=this.corners||{};d.x0=e,d.y0=r,d.x1=t,d.y1=s,d.x2=n,d.y2=i,d.x3=o,d.y3=c,this.corners=d,this._forceUpdate+=1}}function i(e,r,t,s){return new(t||(t=Promise))((function(n,i){function o(e){try{d(s.next(e))}catch(e){i(e)}}function c(e){try{d(s.throw(e))}catch(e){i(e)}}function d(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,c)}d((s=s.apply(e,r||[])).next())}))}n.componentName="PerspectiveMesh";let o=class extends t.Renderer{constructor(){super(...arguments),this.name="MeshSystem",this.meshes={}}init(){this.renderSystem=this.game.getSystem(t.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(e){var t,n;return i(this,void 0,void 0,(function*(){if("PerspectiveMesh"===e.componentName){const i=e.gameObject.id,o=e.component;if(e.type===r.OBSERVER_TYPE.ADD){const n=new s.PerspectiveMesh({texture:new s.Texture,verticesX:o.verticesX,verticesY:o.verticesY});this.meshes[e.gameObject.id]=n,this.containerManager.getContainer(e.gameObject.id).addChildAt(n,0);const c=this.increaseAsyncId(i),d=yield r.resource.getResource(o.resource),a=null===(t=d.data)||void 0===t?void 0:t.image;if(!this.validateAsyncId(i,c))return;if(!a)return void console.error(`GameObject:${e.gameObject.name}'s Mesh resource load error`);n.texture=a,o.corners?this.meshes[e.gameObject.id].setCorners(o.corners.x0,o.corners.y0,o.corners.x1,o.corners.y1,o.corners.x2,o.corners.y2,o.corners.x3,o.corners.y3):n.setCorners(0,0,a.width,0,a.width,a.height,0,a.height)}else if(e.type===r.OBSERVER_TYPE.CHANGE){const t=this.increaseAsyncId(i),s=yield r.resource.getResource(o.resource),c=null===(n=s.data)||void 0===n?void 0:n.image;if(!this.validateAsyncId(i,t))return;if(!c)return void console.error(`GameObject:${e.gameObject.name}'s Mesh resource load error`);this.meshes[e.gameObject.id].texture=c,o.corners&&this.meshes[e.gameObject.id].setCorners(o.corners.x0,o.corners.y0,o.corners.x1,o.corners.y1,o.corners.x2,o.corners.y2,o.corners.x3,o.corners.y3)}else if(e.type===r.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const r=this.meshes[e.gameObject.id];this.containerManager.getContainer(e.gameObject.id).removeChild(r),r.destroy(),delete this.meshes[e.gameObject.id]}}}))}destroy(){var e,r;for(const t in this.meshes){const s=this.meshes[t];null===(r=null===(e=this.containerManager)||void 0===e?void 0:e.getContainer(parseInt(t)))||void 0===r||r.removeChild(s),s.destroy(),delete this.meshes[t]}}};o.systemName="MeshSystem",o=function(e,r,t,s){var n,i=arguments.length,o=i<3?r:null===s?s=Object.getOwnPropertyDescriptor(r,t):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,r,t,s);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(o=(i<3?n(o):i>3?n(r,t,o):n(r,t))||o);return i>3&&o&&Object.defineProperty(r,t,o),o}([r.decorators.componentObserver({PerspectiveMesh:["resource","_forceUpdate"]})],o);var c=o;return e.MeshSystem=c,e.PerspectiveMesh=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,PIXI);window.EVA.plugin.renderer.mesh=window.EVA.plugin.renderer.mesh||_EVA_IIFE_mesh;
1
+ globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{},globalThis.EVA.plugin.renderer=globalThis.EVA.plugin.renderer||{};var _EVA_IIFE_mesh=function(e,r,s,t){"use strict";class n extends r.Component{constructor(){super(...arguments),this.verticesX=10,this.verticesY=10,this._forceUpdate=0}init(e){e&&e.resource&&(this.resource=e.resource),e&&e.verticesX&&(this.verticesX=e.verticesX),e&&e.verticesY&&(this.verticesY=e.verticesY)}setCorners(e,r,s,t,n,i,o,c){const a=this.corners||{};a.x0=e,a.y0=r,a.x1=s,a.y1=t,a.x2=n,a.y2=i,a.x3=o,a.y3=c,this.corners=a,this._forceUpdate+=1}}function i(e,r,s,t){return new(s||(s=Promise))((function(n,i){function o(e){try{a(t.next(e))}catch(e){i(e)}}function c(e){try{a(t.throw(e))}catch(e){i(e)}}function a(e){var r;e.done?n(e.value):(r=e.value,r instanceof s?r:new s((function(e){e(r)}))).then(o,c)}a((t=t.apply(e,r||[])).next())}))}n.componentName="PerspectiveMesh";let o=class extends s.Renderer{constructor(){super(...arguments),this.name="MeshSystem",this.meshes={}}init(){this.renderSystem=this.game.getSystem(s.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(e){var s,n;return i(this,void 0,void 0,(function*(){if("PerspectiveMesh"===e.componentName){const i=e.gameObject.id,o=e.component;if(e.type===r.OBSERVER_TYPE.ADD){const n=new t.PerspectiveMesh({texture:new t.Texture,verticesX:o.verticesX,verticesY:o.verticesY});this.meshes[e.gameObject.id]=n,this.containerManager.getContainer(e.gameObject.id).addChildAt(n,0);const c=this.increaseAsyncId(i),a=yield r.resource.getResource(o.resource),h=null===(s=a.data)||void 0===s?void 0:s.image;if(!this.validateAsyncId(i,c))return;if(!h)return void console.error(`GameObject:${e.gameObject.name}'s Mesh resource load error`);n.texture=h,o.corners?this.meshes[e.gameObject.id].setCorners(o.corners.x0,o.corners.y0,o.corners.x1,o.corners.y1,o.corners.x2,o.corners.y2,o.corners.x3,o.corners.y3):n.setCorners(0,0,h.width,0,h.width,h.height,0,h.height)}else if(e.type===r.OBSERVER_TYPE.CHANGE){const s=this.increaseAsyncId(i),t=yield r.resource.getResource(o.resource),c=null===(n=t.data)||void 0===n?void 0:n.image;if(!this.validateAsyncId(i,s))return;if(!c)return void console.error(`GameObject:${e.gameObject.name}'s Mesh resource load error`);this.meshes[e.gameObject.id].texture=c,o.corners&&this.meshes[e.gameObject.id].setCorners(o.corners.x0,o.corners.y0,o.corners.x1,o.corners.y1,o.corners.x2,o.corners.y2,o.corners.x3,o.corners.y3)}else if(e.type===r.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const r=this.meshes[e.gameObject.id];this.containerManager.getContainer(e.gameObject.id).removeChild(r),r.destroy(),delete this.meshes[e.gameObject.id]}}}))}destroy(){var e,r;for(const s in this.meshes){const t=this.meshes[s];null===(r=null===(e=this.containerManager)||void 0===e?void 0:e.getContainer(parseInt(s)))||void 0===r||r.removeChild(t),t.destroy(),delete this.meshes[s]}}};o.systemName="MeshSystem",o=function(e,r,s,t){var n,i=arguments.length,o=i<3?r:null===t?t=Object.getOwnPropertyDescriptor(r,s):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,r,s,t);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(o=(i<3?n(o):i>3?n(r,s,o):n(r,s))||o);return i>3&&o&&Object.defineProperty(r,s,o),o}([r.decorators.componentObserver({PerspectiveMesh:["resource","_forceUpdate"]})],o);var c=o;return e.MeshSystem=c,e.PerspectiveMesh=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,PIXI);globalThis.EVA.plugin.renderer.mesh=globalThis.EVA.plugin.renderer.mesh||_EVA_IIFE_mesh;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-mesh",
3
- "version": "2.0.0-beta.18",
3
+ "version": "2.0.0-beta.19",
4
4
  "description": "@eva/plugin-renderer-mesh",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-mesh.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.18",
23
- "@eva/eva.js": "2.0.0-beta.18",
22
+ "@eva/plugin-renderer": "2.0.0-beta.19",
23
+ "@eva/eva.js": "2.0.0-beta.19",
24
24
  "pixi.js": "^8.8.1"
25
25
  }
26
26
  }