@eva/plugin-renderer-tiling-sprite 1.2.7-editor.4 → 1.2.7-editor.7
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.
|
@@ -307,6 +307,14 @@ var _EVA_IIFE_tilingSprite = function (exports, eva_js, pluginRenderer, renderer
|
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
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
|
+
|
|
310
318
|
var Vector2 = function () {
|
|
311
319
|
function Vector2() {}
|
|
312
320
|
|
|
@@ -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,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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function o(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 c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};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,r,n){return new(r||(r=Promise))((function(i,o){function c(e){try{s(n.next(e))}catch(e){o(e)}}function a(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(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,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(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 o(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}o(t,e)}(Error);var f="IDE_PROPERTY_METADATA";function
|
|
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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function o(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 c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};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,r,n){return new(r||(r=Promise))((function(i,o){function c(e){try{s(n.next(e))}catch(e){o(e)}}function a(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(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,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(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 o(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}o(t,e)}(Error);var f,d="IDE_PROPERTY_METADATA";function y(e,t,r,n){var i=Reflect.getMetadata("design:type",e,t),o=i===Array,a=function(e){return e===String?"string":e===Number?"number":e===Boolean?"boolean":"unknown"}(i);if("unknown"!==a&&(i=a),n){var s=n();Array.isArray(s)?(o=!0,i=s[0]):i=s}var u=Reflect.getMetadata(d,e.constructor)||{};u[t]=c({type:i,isArray:o},r),Reflect.defineMetadata(d,u,e.constructor)}function g(e,t){return function(r,n){if("symbol"==typeof n)throw new l;var i=function(e,t){return"function"==typeof e?{returnTypeFunc:e,options:t||{}}:{options:e||{}}}(e,t);y(r,n,i.options,i.returnTypeFunc)}}!function(e){e[e.Edit=2]="Edit",e[e.Game=4]="Game",e[e.All=6]="All"}(f||(f={}));var h=function(){function e(){}return a([g({step:.1}),s("design:type",Number)],e.prototype,"x",void 0),a([g({step:.1}),s("design:type",Number)],e.prototype,"y",void 0),e}(),m=function(){function e(){}return a([g({step:1}),s("design:type",Number)],e.prototype,"x",void 0),a([g({step:1}),s("design:type",Number)],e.prototype,"y",void 0),e}(),b=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",a([g(),s("design:type",String)],t.prototype,"resource",void 0),a([g((function(){return h})),s("design:type",Object)],t.prototype,"tileScale",void 0),a([g((function(){return m})),s("design:type",Object)],t.prototype,"tilePosition",void 0),t}(t.Component),v=b,S=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 u(this,void 0,void 0,(function(){var r,i,o,c,a;return p(this,(function(s){switch(s.label){case 0:return r=e.gameObject.id,"TilingSprite"!==e.componentName?[3,7]:(i=e.component,e.type!==t.OBSERVER_TYPE.ADD?[3,2]:(a=new n.TilingSprite(null),this.imgs[e.gameObject.id]=a,this.containerManager.getContainer(e.gameObject.id).addChildAt(a.tilingSprite,0),this.setProp(e.gameObject.id,i),o=this.increaseAsyncId(r),[4,t.resource.getResource(i.resource)]));case 1:return c=s.sent().data,this.validateAsyncId(r,o)?c?(a.image=c.image,[3,7]):(console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error"),[2]):[2];case 2:return e.type!==t.OBSERVER_TYPE.CHANGE?[3,6]:"resource"!==e.prop.prop[0]?[3,4]:(o=this.increaseAsyncId(r),[4,t.resource.getResource(i.resource)]);case 3:return c=s.sent().data,this.validateAsyncId(r,o)?c?(this.imgs[e.gameObject.id].image=c.image,[3,5]):(console.error("GameObject:"+e.gameObject.name+"'s TilingSprite resource load error"),[2]):[2];case 4:this.setProp(e.gameObject.id,i),s.label=5;case 5:return[3,7];case 6:e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(r),a=this.imgs[e.gameObject.id],this.containerManager.getContainer(e.gameObject.id).removeChild(a.tilingSprite),a.tilingSprite.destroy({children:!0}),delete this.imgs[e.gameObject.id]),s.label=7;case 7:return[2]}}))}))},i.prototype.setProp=function(e,t){this.imgs[e].tilingSprite.tilePosition=t.tilePosition,this.imgs[e].tilingSprite.tileScale=t.tileScale},i=a([t.decorators.componentObserver({TilingSprite:[{prop:["resource"],deep:!1},{prop:["tileScale"],deep:!0},{prop:["tilePosition"],deep:!0}]})],i)}(r.Renderer),w=S;return e.TilingSprite=v,e.TilingSpriteSystem=w,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.7-editor.
|
|
3
|
+
"version": "1.2.7-editor.7",
|
|
4
4
|
"description": "@eva/plugin-renderer-tiling-sprite",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-tiling-sprite.esm.js",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eva/inspector-decorator": "0.1.0-alpha.
|
|
22
|
-
"@eva/plugin-renderer": "1.2.7-editor.
|
|
23
|
-
"@eva/renderer-adapter": "1.2.7-editor.
|
|
24
|
-
"@eva/eva.js": "1.2.7-editor.
|
|
21
|
+
"@eva/inspector-decorator": "0.1.0-alpha.2",
|
|
22
|
+
"@eva/plugin-renderer": "1.2.7-editor.7",
|
|
23
|
+
"@eva/renderer-adapter": "1.2.7-editor.7",
|
|
24
|
+
"@eva/eva.js": "1.2.7-editor.7",
|
|
25
25
|
"@types/pixi.js": "^4.8.9"
|
|
26
26
|
}
|
|
27
27
|
}
|