@galacean/effects-plugin-spine

中文文档
2.10.6发布于 2026/11/09MITTypeScriptESM + CJS近 30 天下载 2009

Galacean 效果玩家脊椎插件

中文使用文档
文档目录12 节
  1. 使用量
  2. 简单导入
  3. 获取斯宾克资源列表
  4. 获取动画列表 / 皮肤列表
  5. 获取特定动画的持续时间
  6. 获取纹理创建选项
  7. 设定动画混合持续时间
  8. 设定播放速度
  9. 设置动画
  10. 发展
  11. 开始
  12. 框架比较测试

Galacean 效果 Spine 插件

使用量

简单导入

import { Player } from '@galacean/effects';
import '@galacean/effects-plugin-spine';

获取斯宾克资源列表

import type { SpineDataCache } from '@galacean/effects-plugin-spine';

const comp = await player.play(scene);
const item = comp.getItemByName('itemName');
const spineData: SpineDataCache = item.spineDataCache;

获取动画列表 / 皮肤列表

  1. 获取函数
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName('itemName');
const { skeletonData } = item.spineDataCache;
const animationList = getAnimationList(skeletonData);
const skinList = getSkinList(skeletonData);
  1. 开始后,您可以在 spineDataCache。 。 。 .
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName('itemName')
const { skinList, animationList } = item.spineDataCache;

获取特定动画的持续时间

const animationDuration = getAnimationDuration(skeletonData, animationName);

获取纹理创建选项

import { getTextureOptions } from '@galacean/effects-plugin-spine';

const { magFilter, minFilter, wrapS, wrapT, pma } = getTextureOptions(atlasBuffer);

设定动画混合持续时间

  1. 设定动画的默认组合持续时间( 应在 player.play(中文(简体) )
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);

item.setDefaultMixDuration(mix);
  1. 设定特定过渡的混合时间( 应在 player.play(中文(简体) )
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);

item.setMixDuration(animationOut, animationIn, mix);

设定播放速度

const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);

item.setSpeed(speed);

设置动画

  1. 设定一个动画
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);

item.setAnimation(animationName, speed);
  1. 设定一组动画
const comp = await new Player().loadScene(scene);
const item = comp.getItemByName(name);
const animationList = [animationName1, animationName2, animationName3];

item.setAnimation(animationList, speed);

发展

开始

# demo
pnpm --filter @galacean/effects-plugin-spine dev

在浏览器中打开:http://localhost:8081/demo/

框架比较测试

浏览器打开: http://localhost:8081/test/

版本与发布记录

@galacean/effects-plugin-spine 共发布 273 个版本,首次发布于 2023/11/13;过去 12 个月发布了 49 个版本。

版本发布日期距今
2.10.6latest2026/11/096 天前
2.10.52026/11/069 天前
2.11.0-alpha.3alpha2026/10/2620 天前
2.11.0-alpha.22026/10/2125 天前
2.11.0-alpha.12026/10/121 个月前
2.11.0-alpha.02026/10/121 个月前

其他发布通道:latest-2.3.x → 2.3.8,experimental → 0.0.0-experimental-20250915,beta → 2.7.0-beta.0,latest-1.x → 1.6.10,alpha → 2.11.0-alpha.3。

关于 @galacean/effects-plugin-spine 的常见问题

@galacean/effects-plugin-spine 是什么?

Galacean 效果玩家脊椎插件

如何安装 @galacean/effects-plugin-spine?

在项目目录运行 npm install @galacean/effects-plugin-spine,或使用 pnpm add / yarn add / bun add。

@galacean/effects-plugin-spine 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@galacean/effects-plugin-spine 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@galacean/effects-plugin-spine 可以商用吗?

@galacean/effects-plugin-spine 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@galacean/effects-plugin-spine 的下载量有多少?

根据 npm 官方下载统计,@galacean/effects-plugin-spine 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,009 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@galacean/effects-plugin-spine 还在维护吗?

最新版本 2.10.6 发布于 2026/11/09(6 天前);至今共发布 273 个版本,其中过去 12 个月发布了 49 个;首次发布于 2023/11/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。