@galacean/effects-plugin-spine 2.0.0-alpha.9 → 2.0.0-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.
package/README.md CHANGED
@@ -12,10 +12,11 @@ import '@galacean/effects-plugin-spine';
12
12
  ### Get Spine Resource List
13
13
 
14
14
  ``` ts
15
- import type { SpineResource } from '@galacean/effects-plugin-spine';
15
+ import type { SpineDataCache } from '@galacean/effects-plugin-spine';
16
16
 
17
17
  const comp = await player.play(scene);
18
- const spineData: SpineResource[] = comp.loaderData.spineDatas;
18
+ const item = comp.getItemByName('itemName');
19
+ const spineData: SpineDataCache = item.spineDataCache;
19
20
  ```
20
21
 
21
22
  ### Get Animation List / Skin List
@@ -24,17 +25,18 @@ const spineData: SpineResource[] = comp.loaderData.spineDatas;
24
25
 
25
26
  ``` ts
26
27
  const comp = await new Player().loadScene(scene);
27
- const item = comp.getItemByName(name)
28
+ const item = comp.getItemByName('itemName');
28
29
  const { skeletonData } = item.spineDataCache;
29
30
  const animationList = getAnimationList(skeletonData);
30
31
  const skinList = getSkinList(skeletonData);
31
32
  ```
32
33
 
33
- 2. Get from the `spineDatas` array
34
+ 2. After starting, you can access it in the `spineDataCache`.
34
35
 
35
36
  ``` ts
36
37
  const comp = await new Player().loadScene(scene);
37
- const { skinList, animationList } = comp.loaderData.spineDatas[index];
38
+ const item = comp.getItemByName('itemName')
39
+ const { skinList, animationList } = item.spineDataCache;
38
40
  ```
39
41
 
40
42
  ### Get Duration of a Specific Animation