Skip to content

Repository files navigation

OpenFairyGUI.CSharp

OpenFairyGUI(TypeScript)的 C# 双栖实现。 迁移方案与阶段规划:../OpenFairyGUI/migration/csharp-migration-plan.md(基线锁定上游 tag v0.3.1)。

决策(已确认)

  • D1/D5Core/Functions = netstandard2.1 + C# 8 语法上限(Unity 可引用、尽可能跨平台);Cli/Compare/测试 = net8.0
  • D2:独立 solution(本目录),不进上游仓库
  • R1/R2:G2 两级标准——L1 byte-identical 首选;标准库对不齐接受 L2(解压/解码后一致),差异记 ../OpenFairyGUI/migration/parity-notes.md

结构

项目 对应 TS 包 TFM
src/OpenFairyGUI.Core @openfairygui/core netstandard2.1
src/OpenFairyGUI.Functions @openfairygui/functions netstandard2.1
src/OpenFairyGUI.Cli @openfairygui/cli(ofgui → ofg) net8.0
tools/OpenFairyGUI.Compare (新增)对拍器 net8.0
tests/* 上游 ava 测试移植 net8.0

每个 C# 源文件头部注释标注对应 TS 源文件路径,便于逐文件对照修复。

常用命令

dotnet build                        # 全 solution(LangVersion 已锁 8.0)
dotnet test                         # 回归(对拍测试随阶段固化)
dotnet run --project tools/OpenFairyGUI.Compare -- \
  --golden ../OpenFairyGUI/migration/golden/<fixture>/binary \
  --actual <C#产物目录> --mode binary

阶段状态

阶段 内容 状态
M0 Spike + 对拍地基 ✅ 完成(UIPlayer 空包 byte-identical + Unity 加载验证)
M1 Core XML 层 + 文档模型(G1) ✅ 完成(5/5 fixture 0 diff:Experiments 7/7、Editor 290/290、unity 236/236、layabox 177/177、Game 56/56;90 测试)
M2 Core 二进制协议(G2) ✅ 完成(core 层未压缩 60/60 byte-identical;读侧 59 golden 全字段 diff 0 差异;compressed 为 P-003 L2 语义等价)
M3 property graph + UAM(G3 + 行为对拍) ✅ 完成(G3 0 差异;bridge round-trip TS≡C# 61 文件逐字节;事务 round-trip TS≡C# 逐字节 + 负面对拍 4 例一致)
M4 functions(G2+G3+文本) ✅ 完成(M4-a G3 / M4-b publish TS≡C# / M4-c atlas 像素级 0 mismatch / M4-d codegen 35 文件逐字节 + restore round-trip / M4-Lua gencode 插件端到端跑通)
M5 CLI ✅ 完成(ofg 命令镜像;CLI 对拍 22/22 逐字节;publish 14 产物全绿;Unity 终验通过:真实包加载+组件树构建)
M6 backend + MCP(可选) 未实现(方案定义可选 P2;backend-capabilities 命令已注册、执行体报错提示)

About

C# dual implementation of OpenFairyGUI: FairyGUI project read/write, .fui publishing, xLua plugin adapter | OpenFairyGUI(TypeScript)的 C# 双栖实现:FairyGUI 工程读写、.fui 发布、xLua Lua 插件适配

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages