@eva/plugin-renderer-mesh 2.0.0-beta.11 → 2.0.0-beta.12
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.
|
@@ -103,6 +103,7 @@ var _EVA_IIFE_mesh = function (exports, eva_js, pluginRenderer, pixi_js) {
|
|
|
103
103
|
console.error(`GameObject:${changed.gameObject.name}'s Mesh resource load error`);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
+
mesh.texture = texture;
|
|
106
107
|
if (component.corners) {
|
|
107
108
|
this.meshes[changed.gameObject.id].setCorners(component.corners.x0, component.corners.y0, component.corners.x1, component.corners.y1, component.corners.x2, component.corners.y2, component.corners.x3, component.corners.y3);
|
|
108
109
|
} else {
|
|
@@ -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`);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
|
+
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;
|
|
@@ -104,6 +104,7 @@ let MeshSystem = class MeshSystem extends pluginRenderer.Renderer {
|
|
|
104
104
|
console.error(`GameObject:${changed.gameObject.name}'s Mesh resource load error`);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
+
mesh.texture = texture;
|
|
107
108
|
if (component.corners) {
|
|
108
109
|
this.meshes[changed.gameObject.id].setCorners(component.corners.x0, component.corners.y0, component.corners.x1, component.corners.y1, component.corners.x2, component.corners.y2, component.corners.x3, component.corners.y3);
|
|
109
110
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),r=require("@eva/plugin-renderer"),t=require("pixi.js");class s extends e.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 a=this.corners||{};a.x0=e,a.y0=r,a.x1=t,a.y1=s,a.x2=n,a.y2=i,a.x3=o,a.y3=c,this.corners=a,this._forceUpdate+=1}}s.componentName="PerspectiveMesh";let n=class extends r.Renderer{constructor(){super(...arguments),this.name="MeshSystem",this.meshes={}}init(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(r){var s,n,i,o,c,a;return i=this,o=void 0,a=function*(){if("PerspectiveMesh"===r.componentName){const i=r.gameObject.id,o=r.component;if(r.type===e.OBSERVER_TYPE.ADD){const n=new t.PerspectiveMesh({texture:new t.Texture,verticesX:o.verticesX,verticesY:o.verticesY});this.meshes[r.gameObject.id]=n,this.containerManager.getContainer(r.gameObject.id).addChildAt(n,0);const c=this.increaseAsyncId(i),a=yield e.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:${r.gameObject.name}'s Mesh resource load error`);o.corners?this.meshes[r.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(r.type===e.OBSERVER_TYPE.CHANGE){const t=this.increaseAsyncId(i),s=yield e.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:${r.gameObject.name}'s Mesh resource load error`);this.meshes[r.gameObject.id].texture=c,o.corners&&this.meshes[r.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(r.type===e.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const e=this.meshes[r.gameObject.id];this.containerManager.getContainer(r.gameObject.id).removeChild(e),e.destroy(),delete this.meshes[r.gameObject.id]}}},new((c=void 0)||(c=Promise))((function(e,r){function t(e){try{n(a.next(e))}catch(e){r(e)}}function s(e){try{n(a.throw(e))}catch(e){r(e)}}function n(r){r.done?e(r.value):new c((function(e){e(r.value)})).then(t,s)}n((a=a.apply(i,o||[])).next())}))}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]}}};n.systemName="MeshSystem",n=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),r=require("@eva/plugin-renderer"),t=require("pixi.js");class s extends e.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 a=this.corners||{};a.x0=e,a.y0=r,a.x1=t,a.y1=s,a.x2=n,a.y2=i,a.x3=o,a.y3=c,this.corners=a,this._forceUpdate+=1}}s.componentName="PerspectiveMesh";let n=class extends r.Renderer{constructor(){super(...arguments),this.name="MeshSystem",this.meshes={}}init(){this.renderSystem=this.game.getSystem(r.RendererSystem),this.renderSystem.rendererManager.register(this)}componentChanged(r){var s,n,i,o,c,a;return i=this,o=void 0,a=function*(){if("PerspectiveMesh"===r.componentName){const i=r.gameObject.id,o=r.component;if(r.type===e.OBSERVER_TYPE.ADD){const n=new t.PerspectiveMesh({texture:new t.Texture,verticesX:o.verticesX,verticesY:o.verticesY});this.meshes[r.gameObject.id]=n,this.containerManager.getContainer(r.gameObject.id).addChildAt(n,0);const c=this.increaseAsyncId(i),a=yield e.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:${r.gameObject.name}'s Mesh resource load error`);n.texture=h,o.corners?this.meshes[r.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(r.type===e.OBSERVER_TYPE.CHANGE){const t=this.increaseAsyncId(i),s=yield e.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:${r.gameObject.name}'s Mesh resource load error`);this.meshes[r.gameObject.id].texture=c,o.corners&&this.meshes[r.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(r.type===e.OBSERVER_TYPE.REMOVE){this.increaseAsyncId(i);const e=this.meshes[r.gameObject.id];this.containerManager.getContainer(r.gameObject.id).removeChild(e),e.destroy(),delete this.meshes[r.gameObject.id]}}},new((c=void 0)||(c=Promise))((function(e,r){function t(e){try{n(a.next(e))}catch(e){r(e)}}function s(e){try{n(a.throw(e))}catch(e){r(e)}}function n(r){r.done?e(r.value):new c((function(e){e(r.value)})).then(t,s)}n((a=a.apply(i,o||[])).next())}))}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]}}};n.systemName="MeshSystem",n=
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -100,6 +100,7 @@ let MeshSystem = class MeshSystem extends Renderer {
|
|
|
100
100
|
console.error(`GameObject:${changed.gameObject.name}'s Mesh resource load error`);
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
+
mesh.texture = texture;
|
|
103
104
|
if (component.corners) {
|
|
104
105
|
this.meshes[changed.gameObject.id].setCorners(component.corners.x0, component.corners.y0, component.corners.x1, component.corners.y1, component.corners.x2, component.corners.y2, component.corners.x3, component.corners.y3);
|
|
105
106
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-mesh",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
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.
|
|
23
|
-
"@eva/eva.js": "2.0.0-beta.
|
|
22
|
+
"@eva/plugin-renderer": "2.0.0-beta.12",
|
|
23
|
+
"@eva/eva.js": "2.0.0-beta.12",
|
|
24
24
|
"pixi.js": "^8.6.5"
|
|
25
25
|
}
|
|
26
26
|
}
|