@eva/plugin-renderer-sprite-animation 2.0.1-beta.9 → 2.0.2-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.
@@ -155,6 +155,7 @@ var _EVA_IIFE_spriteAnimation = function (exports, eva_js, pluginRenderer, rende
155
155
  const texture = data.image instanceof pixi_js.Texture ? data.image : pixi_js.Texture.from(data.image);
156
156
  const frames = textureObj.frames || {};
157
157
  const animations = textureObj.animations || {};
158
+ const newAnimations = {};
158
159
  const newFrames = {};
159
160
  for (const key in frames) {
160
161
  const newKey = name + resourceKeySplit + key;
@@ -168,10 +169,12 @@ var _EVA_IIFE_spriteAnimation = function (exports, eva_js, pluginRenderer, rende
168
169
  spriteList.push(newSpriteName);
169
170
  }
170
171
  }
171
- animations[key] = spriteList;
172
+ newAnimations[key] = spriteList;
172
173
  }
173
- textureObj.frames = newFrames;
174
- const spriteSheet = new pixi_js.Spritesheet(texture, textureObj);
174
+ const spriteSheet = new pixi_js.Spritesheet(texture, _extends(_extends({}, textureObj), {
175
+ frames: newFrames,
176
+ animations: newAnimations
177
+ }));
175
178
  spriteSheet.parse().then(() => {
176
179
  const {
177
180
  textures
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},_extends.apply(null,arguments)}globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{},globalThis.EVA.plugin.renderer=globalThis.EVA.plugin.renderer||{};var _EVA_IIFE_spriteAnimation=function(e,t,i,n,o){"use strict";function r(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function s(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function a(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 n=a(t,i);n.key=i,n.type=e}}class m extends t.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.speed=100,this.forwards=!1,this.waitPlay=!1,this.waitStop=!1,this.times=1/0,this.count=0,this.complete=!1}init(e){e&&_extends(this,e),this.on("loop",(()=>{++this.count>=this.times&&(this.forwards?this.gotoAndStop(this.totalFrames-1):this.animate.stop(),this.complete=!0,this.emit("complete"))}))}play(e=1/0){0!==e&&(this.times=e,this.animate?(this.complete&&this.gotoAndStop(0),this.animate.play(),this.count=0,this.complete=!1):this.waitPlay=!0)}stop(){this.animate?this.animate.stop():this.waitStop=!0}set animate(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())}get animate(){return this._animate}gotoAndPlay(e){this.animate.gotoAndPlay(e)}gotoAndStop(e){this.animate.gotoAndStop(e)}get currentFrame(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.currentFrame}get totalFrames(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.totalFrames}}m.componentName="SpriteAnimation",r([c("string")],m.prototype,"resource",void 0),r([c("boolean")],m.prototype,"autoPlay",void 0),r([c("number"),function(e){return function(t,i){a(t,i).step=e}}(10)],m.prototype,"speed",void 0),r([c("boolean")],m.prototype,"forwards",void 0);const p="_s|r|c_";t.resource.registerInstance(t.RESOURCE_TYPE.SPRITE_ANIMATION,(({name:e,data:t})=>new Promise((i=>{const n=t.json.data,r=t.image instanceof o.Texture?t.image:o.Texture.from(t.image),s=n.frames||{},a=n.animations||{},c={};for(const t in s){c[e+p+t]=s[t]}for(const t in a){const i=[];if(a[t]&&a[t].length>=0)for(const n of a[t]){const t=e+p+n;i.push(t)}a[t]=i}n.frames=c;const m=new o.Spritesheet(r,n);m.parse().then((()=>{const{textures:e}=m,t=[];for(const i in e)t.push(e[i]);i(t)}))})))),t.resource.registerDestroy(t.RESOURCE_TYPE.SPRITE_ANIMATION,(({instance:e})=>{if(e)for(const t of e)t.destroy(!0)}));let d=class extends i.Renderer{constructor(){super(...arguments),this.name="SpriteAnimation",this.animates={},this.autoPlay={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=t,this.animates[e.id].animatedSprite.height=i)}componentChanged(e){return s(this,void 0,void 0,(function*(){const i=e.gameObject.id;if("SpriteAnimation"===e.componentName){const n=e.component;if(this.autoPlay[e.gameObject.id]=n.autoPlay,e.type===t.OBSERVER_TYPE.ADD){const o=this.increaseAsyncId(i),{instance:r}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,o))return;r||console.error(`GameObject:${e.gameObject.name}'s Img resource load error`),this.add({frames:r,id:e.gameObject.id,component:n})}else if(e.type===t.OBSERVER_TYPE.CHANGE)if(e.prop&&"speed"===e.prop.prop[0])this.animates[e.gameObject.id].speed=1e3/60/n.speed;else{const o=this.increaseAsyncId(i),{instance:r}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,o))return;r||console.error(`GameObject:${e.gameObject.name}'s Img resource load error`),this.change({frames:r,id:e.gameObject.id,component:n})}else e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(i),this.remove(e.gameObject.id))}}))}add({frames:e,id:t,component:i}){const o=new n.SpriteAnimation({frames:e});this.animates[t]=o,this.containerManager.getContainer(t).addChildAt(o.animatedSprite,0),o.animatedSprite.onComplete=()=>{i.emit("complete")},o.animatedSprite.onFrameChange=()=>{i.emit("frameChange")},o.animatedSprite.onLoop=()=>{i.emit("loop")},i.animate=this.animates[t],this.animates[t].speed=1e3/60/i.speed,this.autoPlay[t]&&o.animatedSprite.play()}change({frames:e,id:t,component:i}){this.remove(t,!0),this.add({frames:e,id:t,component:i})}remove(e,t){const i=this.animates[e];i&&(this.autoPlay[e]=i.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(i.animatedSprite),i.animatedSprite.destroy(),delete this.animates[e],t||delete this.autoPlay[e])}};d.systemName="SpriteAnimation",d=r([t.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],d);var h=d;return e.SpriteAnimation=m,e.SpriteAnimationSystem=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter,PIXI);globalThis.EVA.plugin.renderer.spriteAnimation=globalThis.EVA.plugin.renderer.spriteAnimation||_EVA_IIFE_spriteAnimation;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},_extends.apply(null,arguments)}globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{},globalThis.EVA.plugin.renderer=globalThis.EVA.plugin.renderer||{};var _EVA_IIFE_spriteAnimation=function(e,t,i,n,o){"use strict";function r(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function s(e,t,i,n){return new(i||(i=Promise))(function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function a(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 n=a(t,i);n.key=i,n.type=e}}class m extends t.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.speed=100,this.forwards=!1,this.waitPlay=!1,this.waitStop=!1,this.times=1/0,this.count=0,this.complete=!1}init(e){e&&_extends(this,e),this.on("loop",()=>{++this.count>=this.times&&(this.forwards?this.gotoAndStop(this.totalFrames-1):this.animate.stop(),this.complete=!0,this.emit("complete"))})}play(e=1/0){0!==e&&(this.times=e,this.animate?(this.complete&&this.gotoAndStop(0),this.animate.play(),this.count=0,this.complete=!1):this.waitPlay=!0)}stop(){this.animate?this.animate.stop():this.waitStop=!0}set animate(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())}get animate(){return this._animate}gotoAndPlay(e){this.animate.gotoAndPlay(e)}gotoAndStop(e){this.animate.gotoAndStop(e)}get currentFrame(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.currentFrame}get totalFrames(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.totalFrames}}m.componentName="SpriteAnimation",r([c("string")],m.prototype,"resource",void 0),r([c("boolean")],m.prototype,"autoPlay",void 0),r([c("number"),function(e){return function(t,i){a(t,i).step=e}}(10)],m.prototype,"speed",void 0),r([c("boolean")],m.prototype,"forwards",void 0);const p="_s|r|c_";t.resource.registerInstance(t.RESOURCE_TYPE.SPRITE_ANIMATION,({name:e,data:t})=>new Promise(i=>{const n=t.json.data,r=t.image instanceof o.Texture?t.image:o.Texture.from(t.image),s=n.frames||{},a=n.animations||{},c={},m={};for(const t in s){m[e+p+t]=s[t]}for(const t in a){const i=[];if(a[t]&&a[t].length>=0)for(const n of a[t]){const t=e+p+n;i.push(t)}c[t]=i}const d=new o.Spritesheet(r,_extends(_extends({},n),{frames:m,animations:c}));d.parse().then(()=>{const{textures:e}=d,t=[];for(const i in e)t.push(e[i]);i(t)})})),t.resource.registerDestroy(t.RESOURCE_TYPE.SPRITE_ANIMATION,({instance:e})=>{if(e)for(const t of e)t.destroy(!0)});let d=class extends i.Renderer{constructor(){super(...arguments),this.name="SpriteAnimation",this.animates={},this.autoPlay={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=t,this.animates[e.id].animatedSprite.height=i)}componentChanged(e){return s(this,void 0,void 0,function*(){const i=e.gameObject.id;if("SpriteAnimation"===e.componentName){const n=e.component;if(this.autoPlay[e.gameObject.id]=n.autoPlay,e.type===t.OBSERVER_TYPE.ADD){const o=this.increaseAsyncId(i),{instance:r}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,o))return;r||console.error(`GameObject:${e.gameObject.name}'s Img resource load error`),this.add({frames:r,id:e.gameObject.id,component:n})}else if(e.type===t.OBSERVER_TYPE.CHANGE)if(e.prop&&"speed"===e.prop.prop[0])this.animates[e.gameObject.id].speed=1e3/60/n.speed;else{const o=this.increaseAsyncId(i),{instance:r}=yield t.resource.getResource(n.resource);if(!this.validateAsyncId(i,o))return;r||console.error(`GameObject:${e.gameObject.name}'s Img resource load error`),this.change({frames:r,id:e.gameObject.id,component:n})}else e.type===t.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(i),this.remove(e.gameObject.id))}})}add({frames:e,id:t,component:i}){const o=new n.SpriteAnimation({frames:e});this.animates[t]=o,this.containerManager.getContainer(t).addChildAt(o.animatedSprite,0),o.animatedSprite.onComplete=()=>{i.emit("complete")},o.animatedSprite.onFrameChange=()=>{i.emit("frameChange")},o.animatedSprite.onLoop=()=>{i.emit("loop")},i.animate=this.animates[t],this.animates[t].speed=1e3/60/i.speed,this.autoPlay[t]&&o.animatedSprite.play()}change({frames:e,id:t,component:i}){this.remove(t,!0),this.add({frames:e,id:t,component:i})}remove(e,t){const i=this.animates[e];i&&(this.autoPlay[e]=i.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(i.animatedSprite),i.animatedSprite.destroy(),delete this.animates[e],t||delete this.autoPlay[e])}};d.systemName="SpriteAnimation",d=r([t.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],d);var h=d;return e.SpriteAnimation=m,e.SpriteAnimationSystem=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({},EVA,EVA.plugin.renderer,EVA.rendererAdapter,PIXI);globalThis.EVA.plugin.renderer.spriteAnimation=globalThis.EVA.plugin.renderer.spriteAnimation||_EVA_IIFE_spriteAnimation;
@@ -8,19 +8,19 @@ var pluginRenderer = require('@eva/plugin-renderer');
8
8
  var rendererAdapter = require('@eva/renderer-adapter');
9
9
  var pixi_js = require('pixi.js');
10
10
 
11
- /*! *****************************************************************************
12
- Copyright (c) Microsoft Corporation. All rights reserved.
13
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
14
- this file except in compliance with the License. You may obtain a copy of the
15
- License at http://www.apache.org/licenses/LICENSE-2.0
11
+ /******************************************************************************
12
+ Copyright (c) Microsoft Corporation.
16
13
 
17
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
19
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
20
- MERCHANTABLITY OR NON-INFRINGEMENT.
14
+ Permission to use, copy, modify, and/or distribute this software for any
15
+ purpose with or without fee is hereby granted.
21
16
 
22
- See the Apache Version 2.0 License for specific language governing permissions
23
- and limitations under the License.
17
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
+ PERFORMANCE OF THIS SOFTWARE.
24
24
  ***************************************************************************** */
25
25
 
26
26
  function __decorate(decorators, target, key, desc) {
@@ -31,27 +31,88 @@ function __decorate(decorators, target, key, desc) {
31
31
  }
32
32
 
33
33
  function __awaiter(thisArg, _arguments, P, generator) {
34
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
34
35
  return new (P || (P = Promise))(function (resolve, reject) {
35
36
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
36
37
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
37
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
38
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
38
39
  step((generator = generator.apply(thisArg, _arguments || [])).next());
39
40
  });
40
- }
41
+ }
42
+
43
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
44
+ var e = new Error(message);
45
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
46
+ };
41
47
 
48
+ /**
49
+ * 精灵动画组件
50
+ *
51
+ * SpriteAnimation 组件用于播放帧动画(序列帧动画)。
52
+ * 通过快速切换精灵图集中的不同帧,实现动画效果,
53
+ * 适用于角色动作、特效、UI 动画等场景。
54
+ *
55
+ * 主要功能:
56
+ * - 支持自动播放和手动控制
57
+ * - 可配置播放速度和循环次数
58
+ * - 支持跳转到指定帧
59
+ * - 提供播放完成事件
60
+ * - 支持 forwards 模式(停在最后一帧)
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * // 基础用法 - 自动播放
65
+ * const character = new GameObject('character');
66
+ * character.addComponent(new SpriteAnimation({
67
+ * resource: 'walkAnimation', // 帧动画资源
68
+ * autoPlay: true,
69
+ * speed: 100 // 播放速度(毫秒/帧)
70
+ * }));
71
+ *
72
+ * // 控制播放
73
+ * const anim = character.getComponent('SpriteAnimation');
74
+ * anim.play(3); // 播放 3 次
75
+ * anim.play(Infinity); // 无限循环
76
+ * anim.stop(); // 停止播放
77
+ * anim.gotoAndPlay(10); // 跳到第 10 帧并播放
78
+ * anim.gotoAndStop(0); // 跳到第 0 帧并停止
79
+ *
80
+ * // 监听播放完成
81
+ * anim.on('complete', () => {
82
+ * console.log('动画播放完成');
83
+ * });
84
+ * ```
85
+ */
42
86
  class SpriteAnimation$2 extends eva_js.Component {
43
87
  constructor() {
44
88
  super(...arguments);
89
+ /** 帧动画资源名称 */
45
90
  this.resource = '';
91
+ /** 是否自动播放 */
46
92
  this.autoPlay = true;
93
+ /** 播放速度(毫秒/帧) */
47
94
  this.speed = 100;
95
+ /** 是否在最后一帧停止(forwards 模式) */
48
96
  this.forwards = false;
97
+ /** 等待播放标志(资源加载前调用 play) */
49
98
  this.waitPlay = false;
99
+ /** 等待停止标志 */
50
100
  this.waitStop = false;
101
+ /** 播放次数 */
51
102
  this.times = Infinity;
103
+ /** 当前已播放次数 */
52
104
  this.count = 0;
105
+ /** 是否播放完成 */
53
106
  this.complete = false;
54
107
  }
108
+ /**
109
+ * 初始化组件
110
+ * @param obj - 初始化参数
111
+ * @param obj.resource - 帧动画资源名称
112
+ * @param obj.autoPlay - 是否自动播放
113
+ * @param obj.speed - 播放速度
114
+ * @param obj.forwards - 是否停在最后一帧
115
+ */
55
116
  init(obj) {
56
117
  obj && Object.assign(this, obj);
57
118
  this.on('loop', () => {
@@ -121,6 +182,7 @@ class SpriteAnimation$2 extends eva_js.Component {
121
182
  return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.totalFrames;
122
183
  }
123
184
  }
185
+ /** 组件名称 */
124
186
  SpriteAnimation$2.componentName = 'SpriteAnimation';
125
187
  __decorate([
126
188
  inspectorDecorator.type('string')
@@ -143,6 +205,7 @@ eva_js.resource.registerInstance(eva_js.RESOURCE_TYPE.SPRITE_ANIMATION, ({ name,
143
205
  const texture = data.image instanceof pixi_js.Texture ? data.image : pixi_js.Texture.from(data.image);
144
206
  const frames = textureObj.frames || {};
145
207
  const animations = textureObj.animations || {};
208
+ const newAnimations = {};
146
209
  const newFrames = {};
147
210
  for (const key in frames) {
148
211
  const newKey = name + resourceKeySplit + key;
@@ -156,10 +219,9 @@ eva_js.resource.registerInstance(eva_js.RESOURCE_TYPE.SPRITE_ANIMATION, ({ name,
156
219
  spriteList.push(newSpriteName);
157
220
  }
158
221
  }
159
- animations[key] = spriteList;
222
+ newAnimations[key] = spriteList;
160
223
  }
161
- textureObj.frames = newFrames;
162
- const spriteSheet = new pixi_js.Spritesheet(texture, textureObj);
224
+ const spriteSheet = new pixi_js.Spritesheet(texture, Object.assign(Object.assign({}, textureObj), { frames: newFrames, animations: newAnimations }));
163
225
  spriteSheet.parse().then(() => {
164
226
  const { textures } = spriteSheet;
165
227
  const spriteFrames = [];
@@ -1,16 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/inspector-decorator"),i=require("@eva/plugin-renderer"),a=require("@eva/renderer-adapter"),n=require("pixi.js");
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
- this file except in compliance with the License. You may obtain a copy of the
6
- License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
- MERCHANTABLITY OR NON-INFRINGEMENT.
12
-
13
- See the Apache Version 2.0 License for specific language governing permissions
14
- and limitations under the License.
15
- ***************************************************************************** */
16
- function s(e,t,i,a){var n,s=arguments.length,o=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o}class o extends e.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.speed=100,this.forwards=!1,this.waitPlay=!1,this.waitStop=!1,this.times=1/0,this.count=0,this.complete=!1}init(e){e&&Object.assign(this,e),this.on("loop",(()=>{++this.count>=this.times&&(this.forwards?this.gotoAndStop(this.totalFrames-1):this.animate.stop(),this.complete=!0,this.emit("complete"))}))}play(e=1/0){0!==e&&(this.times=e,this.animate?(this.complete&&this.gotoAndStop(0),this.animate.play(),this.count=0,this.complete=!1):this.waitPlay=!0)}stop(){this.animate?this.animate.stop():this.waitStop=!0}set animate(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())}get animate(){return this._animate}gotoAndPlay(e){this.animate.gotoAndPlay(e)}gotoAndStop(e){this.animate.gotoAndStop(e)}get currentFrame(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.currentFrame}get totalFrames(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.totalFrames}}o.componentName="SpriteAnimation",s([t.type("string")],o.prototype,"resource",void 0),s([t.type("boolean")],o.prototype,"autoPlay",void 0),s([t.type("number"),t.step(10)],o.prototype,"speed",void 0),s([t.type("boolean")],o.prototype,"forwards",void 0);const r="_s|r|c_";e.resource.registerInstance(e.RESOURCE_TYPE.SPRITE_ANIMATION,(({name:e,data:t})=>new Promise((i=>{const a=t.json.data,s=t.image instanceof n.Texture?t.image:n.Texture.from(t.image),o=a.frames||{},m=a.animations||{},c={};for(const t in o){c[e+r+t]=o[t]}for(const t in m){const i=[];if(m[t]&&m[t].length>=0)for(const a of m[t]){const t=e+r+a;i.push(t)}m[t]=i}a.frames=c;const p=new n.Spritesheet(s,a);p.parse().then((()=>{const{textures:e}=p,t=[];for(const i in e)t.push(e[i]);i(t)}))})))),e.resource.registerDestroy(e.RESOURCE_TYPE.SPRITE_ANIMATION,(({instance:e})=>{if(e)for(const t of e)t.destroy(!0)}));let m=class extends i.Renderer{constructor(){super(...arguments),this.name="SpriteAnimation",this.animates={},this.autoPlay={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=t,this.animates[e.id].animatedSprite.height=i)}componentChanged(t){return i=this,a=void 0,s=function*(){const i=t.gameObject.id;if("SpriteAnimation"===t.componentName){const a=t.component;if(this.autoPlay[t.gameObject.id]=a.autoPlay,t.type===e.OBSERVER_TYPE.ADD){const n=this.increaseAsyncId(i),{instance:s}=yield e.resource.getResource(a.resource);if(!this.validateAsyncId(i,n))return;s||console.error(`GameObject:${t.gameObject.name}'s Img resource load error`),this.add({frames:s,id:t.gameObject.id,component:a})}else if(t.type===e.OBSERVER_TYPE.CHANGE)if(t.prop&&"speed"===t.prop.prop[0])this.animates[t.gameObject.id].speed=1e3/60/a.speed;else{const n=this.increaseAsyncId(i),{instance:s}=yield e.resource.getResource(a.resource);if(!this.validateAsyncId(i,n))return;s||console.error(`GameObject:${t.gameObject.name}'s Img resource load error`),this.change({frames:s,id:t.gameObject.id,component:a})}else t.type===e.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(i),this.remove(t.gameObject.id))}},new((n=void 0)||(n=Promise))((function(e,t){function o(e){try{m(s.next(e))}catch(e){t(e)}}function r(e){try{m(s.throw(e))}catch(e){t(e)}}function m(t){t.done?e(t.value):new n((function(e){e(t.value)})).then(o,r)}m((s=s.apply(i,a||[])).next())}));var i,a,n,s}add({frames:e,id:t,component:i}){const n=new a.SpriteAnimation({frames:e});this.animates[t]=n,this.containerManager.getContainer(t).addChildAt(n.animatedSprite,0),n.animatedSprite.onComplete=()=>{i.emit("complete")},n.animatedSprite.onFrameChange=()=>{i.emit("frameChange")},n.animatedSprite.onLoop=()=>{i.emit("loop")},i.animate=this.animates[t],this.animates[t].speed=1e3/60/i.speed,this.autoPlay[t]&&n.animatedSprite.play()}change({frames:e,id:t,component:i}){this.remove(t,!0),this.add({frames:e,id:t,component:i})}remove(e,t){const i=this.animates[e];i&&(this.autoPlay[e]=i.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(i.animatedSprite),i.animatedSprite.destroy(),delete this.animates[e],t||delete this.autoPlay[e])}};m.systemName="SpriteAnimation",m=s([e.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],m);var c=m;exports.SpriteAnimation=o,exports.SpriteAnimationSystem=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@eva/eva.js"),t=require("@eva/inspector-decorator"),i=require("@eva/plugin-renderer"),a=require("@eva/renderer-adapter"),n=require("pixi.js");function s(e,t,i,a){var n,s=arguments.length,o=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o}function o(e,t,i,a){return new(i||(i=Promise))(function(n,s){function o(e){try{m(a.next(e))}catch(e){s(e)}}function r(e){try{m(a.throw(e))}catch(e){s(e)}}function m(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,r)}m((a=a.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class r extends e.Component{constructor(){super(...arguments),this.resource="",this.autoPlay=!0,this.speed=100,this.forwards=!1,this.waitPlay=!1,this.waitStop=!1,this.times=1/0,this.count=0,this.complete=!1}init(e){e&&Object.assign(this,e),this.on("loop",()=>{++this.count>=this.times&&(this.forwards?this.gotoAndStop(this.totalFrames-1):this.animate.stop(),this.complete=!0,this.emit("complete"))})}play(e=1/0){0!==e&&(this.times=e,this.animate?(this.complete&&this.gotoAndStop(0),this.animate.play(),this.count=0,this.complete=!1):this.waitPlay=!0)}stop(){this.animate?this.animate.stop():this.waitStop=!0}set animate(e){this._animate=e,this.waitPlay&&(this.waitPlay=!1,this.play(this.times)),this.waitStop&&(this.waitStop=!1,this.stop())}get animate(){return this._animate}gotoAndPlay(e){this.animate.gotoAndPlay(e)}gotoAndStop(e){this.animate.gotoAndStop(e)}get currentFrame(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.currentFrame}get totalFrames(){var e,t;return null===(t=null===(e=this.animate)||void 0===e?void 0:e.animatedSprite)||void 0===t?void 0:t.totalFrames}}r.componentName="SpriteAnimation",s([t.type("string")],r.prototype,"resource",void 0),s([t.type("boolean")],r.prototype,"autoPlay",void 0),s([t.type("number"),t.step(10)],r.prototype,"speed",void 0),s([t.type("boolean")],r.prototype,"forwards",void 0);const m="_s|r|c_";e.resource.registerInstance(e.RESOURCE_TYPE.SPRITE_ANIMATION,({name:e,data:t})=>new Promise(i=>{const a=t.json.data,s=t.image instanceof n.Texture?t.image:n.Texture.from(t.image),o=a.frames||{},r=a.animations||{},c={},p={};for(const t in o){p[e+m+t]=o[t]}for(const t in r){const i=[];if(r[t]&&r[t].length>=0)for(const a of r[t]){const t=e+m+a;i.push(t)}c[t]=i}const d=new n.Spritesheet(s,Object.assign(Object.assign({},a),{frames:p,animations:c}));d.parse().then(()=>{const{textures:e}=d,t=[];for(const i in e)t.push(e[i]);i(t)})})),e.resource.registerDestroy(e.RESOURCE_TYPE.SPRITE_ANIMATION,({instance:e})=>{if(e)for(const t of e)t.destroy(!0)});let c=class extends i.Renderer{constructor(){super(...arguments),this.name="SpriteAnimation",this.animates={},this.autoPlay={}}init(){this.renderSystem=this.game.getSystem(i.RendererSystem),this.renderSystem.rendererManager.register(this)}rendererUpdate(e){const{width:t,height:i}=e.transform.size;this.animates[e.id]&&(this.animates[e.id].animatedSprite.width=t,this.animates[e.id].animatedSprite.height=i)}componentChanged(t){return o(this,void 0,void 0,function*(){const i=t.gameObject.id;if("SpriteAnimation"===t.componentName){const a=t.component;if(this.autoPlay[t.gameObject.id]=a.autoPlay,t.type===e.OBSERVER_TYPE.ADD){const n=this.increaseAsyncId(i),{instance:s}=yield e.resource.getResource(a.resource);if(!this.validateAsyncId(i,n))return;s||console.error(`GameObject:${t.gameObject.name}'s Img resource load error`),this.add({frames:s,id:t.gameObject.id,component:a})}else if(t.type===e.OBSERVER_TYPE.CHANGE)if(t.prop&&"speed"===t.prop.prop[0])this.animates[t.gameObject.id].speed=1e3/60/a.speed;else{const n=this.increaseAsyncId(i),{instance:s}=yield e.resource.getResource(a.resource);if(!this.validateAsyncId(i,n))return;s||console.error(`GameObject:${t.gameObject.name}'s Img resource load error`),this.change({frames:s,id:t.gameObject.id,component:a})}else t.type===e.OBSERVER_TYPE.REMOVE&&(this.increaseAsyncId(i),this.remove(t.gameObject.id))}})}add({frames:e,id:t,component:i}){const n=new a.SpriteAnimation({frames:e});this.animates[t]=n,this.containerManager.getContainer(t).addChildAt(n.animatedSprite,0),n.animatedSprite.onComplete=()=>{i.emit("complete")},n.animatedSprite.onFrameChange=()=>{i.emit("frameChange")},n.animatedSprite.onLoop=()=>{i.emit("loop")},i.animate=this.animates[t],this.animates[t].speed=1e3/60/i.speed,this.autoPlay[t]&&n.animatedSprite.play()}change({frames:e,id:t,component:i}){this.remove(t,!0),this.add({frames:e,id:t,component:i})}remove(e,t){const i=this.animates[e];i&&(this.autoPlay[e]=i.animatedSprite.playing,this.containerManager.getContainer(e).removeChild(i.animatedSprite),i.animatedSprite.destroy(),delete this.animates[e],t||delete this.autoPlay[e])}};c.systemName="SpriteAnimation",c=s([e.decorators.componentObserver({SpriteAnimation:["speed","resource"]})],c);var p=c;exports.SpriteAnimation=r,exports.SpriteAnimationSystem=p;
@@ -7,18 +7,75 @@ import { RendererManager } from '@eva/plugin-renderer';
7
7
  import { RendererSystem } from '@eva/plugin-renderer';
8
8
  import { SpriteAnimation as SpriteAnimation_2 } from '@eva/renderer-adapter';
9
9
 
10
+ /**
11
+ * 精灵动画组件
12
+ *
13
+ * SpriteAnimation 组件用于播放帧动画(序列帧动画)。
14
+ * 通过快速切换精灵图集中的不同帧,实现动画效果,
15
+ * 适用于角色动作、特效、UI 动画等场景。
16
+ *
17
+ * 主要功能:
18
+ * - 支持自动播放和手动控制
19
+ * - 可配置播放速度和循环次数
20
+ * - 支持跳转到指定帧
21
+ * - 提供播放完成事件
22
+ * - 支持 forwards 模式(停在最后一帧)
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // 基础用法 - 自动播放
27
+ * const character = new GameObject('character');
28
+ * character.addComponent(new SpriteAnimation({
29
+ * resource: 'walkAnimation', // 帧动画资源
30
+ * autoPlay: true,
31
+ * speed: 100 // 播放速度(毫秒/帧)
32
+ * }));
33
+ *
34
+ * // 控制播放
35
+ * const anim = character.getComponent('SpriteAnimation');
36
+ * anim.play(3); // 播放 3 次
37
+ * anim.play(Infinity); // 无限循环
38
+ * anim.stop(); // 停止播放
39
+ * anim.gotoAndPlay(10); // 跳到第 10 帧并播放
40
+ * anim.gotoAndStop(0); // 跳到第 0 帧并停止
41
+ *
42
+ * // 监听播放完成
43
+ * anim.on('complete', () => {
44
+ * console.log('动画播放完成');
45
+ * });
46
+ * ```
47
+ */
10
48
  export declare class SpriteAnimation extends Component<SpriteAnimationParams> {
49
+ /** 组件名称 */
11
50
  static componentName: string;
51
+ /** 帧动画资源名称 */
12
52
  resource: string;
53
+ /** 是否自动播放 */
13
54
  autoPlay: boolean;
55
+ /** 播放速度(毫秒/帧) */
14
56
  speed: number;
57
+ /** 是否在最后一帧停止(forwards 模式) */
15
58
  forwards: boolean;
59
+ /** 动画引擎实例 */
16
60
  _animate: SpriteAnimation_2;
61
+ /** 等待播放标志(资源加载前调用 play) */
17
62
  private waitPlay;
63
+ /** 等待停止标志 */
18
64
  private waitStop;
65
+ /** 播放次数 */
19
66
  private times;
67
+ /** 当前已播放次数 */
20
68
  private count;
69
+ /** 是否播放完成 */
21
70
  private complete;
71
+ /**
72
+ * 初始化组件
73
+ * @param obj - 初始化参数
74
+ * @param obj.resource - 帧动画资源名称
75
+ * @param obj.autoPlay - 是否自动播放
76
+ * @param obj.speed - 播放速度
77
+ * @param obj.forwards - 是否停在最后一帧
78
+ */
22
79
  init(obj?: SpriteAnimationParams): void;
23
80
  play(times?: number): void;
24
81
  stop(): void;
@@ -34,6 +91,7 @@ export declare interface SpriteAnimationParams {
34
91
  resource: string;
35
92
  autoPlay?: boolean;
36
93
  speed?: number;
94
+ /** Stop at last frame */
37
95
  forwards?: boolean;
38
96
  }
39
97
 
@@ -4,19 +4,19 @@ import { Renderer, RendererSystem } from '@eva/plugin-renderer';
4
4
  import { SpriteAnimation as SpriteAnimation$3 } from '@eva/renderer-adapter';
5
5
  import { Texture, Spritesheet } from 'pixi.js';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
7
+ /******************************************************************************
8
+ Copyright (c) Microsoft Corporation.
12
9
 
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
17
12
 
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
21
 
22
22
  function __decorate(decorators, target, key, desc) {
@@ -27,27 +27,88 @@ function __decorate(decorators, target, key, desc) {
27
27
  }
28
28
 
29
29
  function __awaiter(thisArg, _arguments, P, generator) {
30
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
31
  return new (P || (P = Promise))(function (resolve, reject) {
31
32
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
33
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
34
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
35
  step((generator = generator.apply(thisArg, _arguments || [])).next());
35
36
  });
36
- }
37
+ }
38
+
39
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
40
+ var e = new Error(message);
41
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
42
+ };
37
43
 
44
+ /**
45
+ * 精灵动画组件
46
+ *
47
+ * SpriteAnimation 组件用于播放帧动画(序列帧动画)。
48
+ * 通过快速切换精灵图集中的不同帧,实现动画效果,
49
+ * 适用于角色动作、特效、UI 动画等场景。
50
+ *
51
+ * 主要功能:
52
+ * - 支持自动播放和手动控制
53
+ * - 可配置播放速度和循环次数
54
+ * - 支持跳转到指定帧
55
+ * - 提供播放完成事件
56
+ * - 支持 forwards 模式(停在最后一帧)
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * // 基础用法 - 自动播放
61
+ * const character = new GameObject('character');
62
+ * character.addComponent(new SpriteAnimation({
63
+ * resource: 'walkAnimation', // 帧动画资源
64
+ * autoPlay: true,
65
+ * speed: 100 // 播放速度(毫秒/帧)
66
+ * }));
67
+ *
68
+ * // 控制播放
69
+ * const anim = character.getComponent('SpriteAnimation');
70
+ * anim.play(3); // 播放 3 次
71
+ * anim.play(Infinity); // 无限循环
72
+ * anim.stop(); // 停止播放
73
+ * anim.gotoAndPlay(10); // 跳到第 10 帧并播放
74
+ * anim.gotoAndStop(0); // 跳到第 0 帧并停止
75
+ *
76
+ * // 监听播放完成
77
+ * anim.on('complete', () => {
78
+ * console.log('动画播放完成');
79
+ * });
80
+ * ```
81
+ */
38
82
  class SpriteAnimation$2 extends Component {
39
83
  constructor() {
40
84
  super(...arguments);
85
+ /** 帧动画资源名称 */
41
86
  this.resource = '';
87
+ /** 是否自动播放 */
42
88
  this.autoPlay = true;
89
+ /** 播放速度(毫秒/帧) */
43
90
  this.speed = 100;
91
+ /** 是否在最后一帧停止(forwards 模式) */
44
92
  this.forwards = false;
93
+ /** 等待播放标志(资源加载前调用 play) */
45
94
  this.waitPlay = false;
95
+ /** 等待停止标志 */
46
96
  this.waitStop = false;
97
+ /** 播放次数 */
47
98
  this.times = Infinity;
99
+ /** 当前已播放次数 */
48
100
  this.count = 0;
101
+ /** 是否播放完成 */
49
102
  this.complete = false;
50
103
  }
104
+ /**
105
+ * 初始化组件
106
+ * @param obj - 初始化参数
107
+ * @param obj.resource - 帧动画资源名称
108
+ * @param obj.autoPlay - 是否自动播放
109
+ * @param obj.speed - 播放速度
110
+ * @param obj.forwards - 是否停在最后一帧
111
+ */
51
112
  init(obj) {
52
113
  obj && Object.assign(this, obj);
53
114
  this.on('loop', () => {
@@ -117,6 +178,7 @@ class SpriteAnimation$2 extends Component {
117
178
  return (_b = (_a = this.animate) === null || _a === void 0 ? void 0 : _a.animatedSprite) === null || _b === void 0 ? void 0 : _b.totalFrames;
118
179
  }
119
180
  }
181
+ /** 组件名称 */
120
182
  SpriteAnimation$2.componentName = 'SpriteAnimation';
121
183
  __decorate([
122
184
  type('string')
@@ -139,6 +201,7 @@ resource.registerInstance(RESOURCE_TYPE.SPRITE_ANIMATION, ({ name, data }) => {
139
201
  const texture = data.image instanceof Texture ? data.image : Texture.from(data.image);
140
202
  const frames = textureObj.frames || {};
141
203
  const animations = textureObj.animations || {};
204
+ const newAnimations = {};
142
205
  const newFrames = {};
143
206
  for (const key in frames) {
144
207
  const newKey = name + resourceKeySplit + key;
@@ -152,10 +215,9 @@ resource.registerInstance(RESOURCE_TYPE.SPRITE_ANIMATION, ({ name, data }) => {
152
215
  spriteList.push(newSpriteName);
153
216
  }
154
217
  }
155
- animations[key] = spriteList;
218
+ newAnimations[key] = spriteList;
156
219
  }
157
- textureObj.frames = newFrames;
158
- const spriteSheet = new Spritesheet(texture, textureObj);
220
+ const spriteSheet = new Spritesheet(texture, Object.assign(Object.assign({}, textureObj), { frames: newFrames, animations: newAnimations }));
159
221
  spriteSheet.parse().then(() => {
160
222
  const { textures } = spriteSheet;
161
223
  const spriteFrames = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eva/plugin-renderer-sprite-animation",
3
- "version": "2.0.1-beta.9",
3
+ "version": "2.0.2-beta.0",
4
4
  "description": "@eva/plugin-renderer-sprite-animation",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-sprite-animation.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": "2.0.1-beta.9",
23
- "@eva/renderer-adapter": "2.0.1-beta.9",
24
- "@eva/eva.js": "2.0.1-beta.9",
25
- "pixi.js": "^8.8.1"
22
+ "@eva/plugin-renderer": "2.0.2-beta.0",
23
+ "@eva/renderer-adapter": "2.0.2-beta.0",
24
+ "@eva/eva.js": "2.0.2-beta.0",
25
+ "pixi.js": "^8.17.0"
26
26
  }
27
27
  }