@galacean/engine-spine 0.0.0-experimental-2024071801 → 0.0.0-experimental-2024071901

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.
package/README.md CHANGED
@@ -24,15 +24,17 @@ import { SpineAnimationRenderer } from '@galacean/engine-spine';
24
24
  addSpine();
25
25
 
26
26
  async function addSpine() {
27
- const spineEntity = await engine.resourceManager.load(
27
+ const resource = await engine.resourceManager.load(
28
28
  {
29
- url: 'https://sbfkcel.github.io/pixi-spine-debug/assets/spine/spineboy-pro.json',
29
+ url: 'https://mdn.alipayobjects.com/huamei_kz4wfo/uri/file/as/2/kz4wfo/4/mp/yKbdfgijyLGzQDyQ/spineboy/spineboy.json',
30
30
  type: 'spine',
31
31
  },
32
32
  );
33
+ const spineEntity = new Entity(engine);
34
+ const spine = entity.addComponent(SpineAnimationRenderer);
35
+ spine.resource = resource;
36
+ spine.defaultState.animationName = 'walk';
33
37
  rootEntity.addChild(spineEntity);
34
- const spineAnimation = spineEntity.getComponent(SpineAnimationRenderer);
35
- spineAnimation.state.setAnimation(0, 'walk', true);
36
38
  }
37
39
  ```
38
40
 
@@ -76,4 +78,4 @@ Make sure to read the [Contributing Guide](.github/HOW_TO_CONTRIBUTE.md) before
76
78
  ## License
77
79
 
78
80
 
79
- The Oasis Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.
81
+ The Galacean Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.