mcpField
U
unity-history

unity-history

github.com/besty0728开发1.9k79 次安装今天更新
代码仓库

关于 unity-history

unity-history 是用于管理 Unity Editor 撤销与重做历史的技能,可查看当前撤销组并按步数撤销或重做操作。

主要功能

  1. 01查看当前撤销组名称与索引
  2. 02撤销一项或多项操作
  3. 03重做一项或多项操作

适用场景

  1. 01检查当前撤销历史位置
  2. 02撤销最近的编辑操作
  3. 03恢复已撤销的更改

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/besty0728/unity-skills --skill unity-history

安装后在 Claude Code 中输入/unity-history确认已加载。

详细介绍

**调用本模块中的任何技能之前:**如果你打算根据技能名称或描述猜测参数来调用技能,请先停下——先阅读本文件(或通过 GET /skills/recommend?includeSchema=true 获取其 schema)。如果你已从 recommend/schema 获得参数定义,则可直接进行 dryRun。

触发条件

  • 查看或浏览撤销历史
  • 逐步撤销/重做
  • 审查改动
  • 查看或浏览撤销历史、逐步撤销/重做、审查改动

历史记录技能

管理 Unity Editor 撤销/重做历史。

运行模式

本模块 history_get_current(纯读)标记为 SkillMode.SemiAuto,三档下均可直接执行;history_undo / history_redo 会改变场景状态,默认标记为 SkillMode.FullAuto(Operation=Execute),Approval 模式下需 grant。不含 NeverInSemi 高危技能。

history_undo / history_redo 会重放 Unity 自带的原生 Undo/Redo 堆栈,其中的内容无法像 workflow 模块的任务快照那样按写入类别分类,因此与 workflow_undo_task / workflow_session_undo 不同,它们不执行 payload 级别的 SURFACE_EXCLUDED 检查。

切勿(常见臆测):

  • history_list / history_get 不存在 → 使用 history_get_current 获取当前撤销组
  • history_clear 不存在 → 无法通过 API 清除 Unity 撤销历史
  • history_save 不存在 → 撤销历史由 Unity 自动管理

路由:

  • 简单撤销/重做 → 使用 history_undo / history_redo(本模块)或 editor_undo / editor_redo
  • 持久化的任务级撤销 → 使用 workflow 模块
  • 对话级撤销 → 使用 workflow 模块中的 workflow_session_undo

技能

history_undo

撤销上一个操作(或多个步骤)。

参数类型必填默认值描述
stepsint否1要执行的撤销步数

返回: { success, undoneSteps }

history_redo

重做上一个已撤销的操作(或多个步骤)。

参数类型必填默认值描述
stepsint否1要执行的重做步数

返回: { success, redoneSteps }

history_get_current

获取当前撤销组的名称。

无参数。

返回: { success, currentGroup, groupIndex }

精确签名

精确名称、参数、默认值和返回值由 GET /skills/schema 或 unity_skills.get_skill_schema() 定义,而非本文件。

评论

支持 Markdown