Add concrete component script field support

This commit is contained in:
2026-04-03 16:51:42 +08:00
parent 73415915e6
commit e0e5c1fcaa
11 changed files with 507 additions and 4 deletions

View File

@@ -277,3 +277,11 @@ C# 脚本模块已经完成了第一阶段的核心闭环,不再是“从 0
- `ProjectScriptAssemblyTest.*` 现改为使用独立的测试项目程序集输出目录,不再依赖真实 `project/Library/ScriptAssemblies`,避免与 editor / Mono 持有的文件锁互相干扰。
- 已通过完整 `ScriptFieldStorage_Test.*:MonoScriptRuntimeTest.*:ProjectScriptAssemblyTest.*` 验证;输出全绿,`exit code 3` 仍为既有历史现象。
- 字段系统下一步建议切到:组件引用字段支持
- 已完成字段系统第三小项:具体组件引用字段支持
- `MonoScriptRuntime` 现已支持把常用具体组件字段纳入脚本字段模型,包括 `Transform``Camera``Light``MeshFilter``MeshRenderer`,以及具体脚本类字段(`MonoBehaviour` 子类)。
- 字段存储层已新增 `ScriptFieldType::Component``ComponentReference`,序列化格式同时保存 `gameObjectUUID``scriptComponentUUID`,从而能区分内建组件引用与脚本组件引用。
- 当前刻意暂不支持抽象基类字段:`Component``Behaviour``MonoBehaviour`;这样先保证字段定位与场景 roundtrip 语义稳定,不把抽象匹配和 editor 复杂度提前拉进主线。
- 已新增 `ComponentFieldMetadataProbe` / `ComponentFieldProbe` 与对应 C++ 回归测试,覆盖字段发现、默认空引用、存储值应用、运行时写回,以及场景 roundtrip 恢复。
- 本步定向测试 `ScriptFieldStorage_Test.*:ScriptComponent_Test.*:MonoScriptRuntimeTest.ClassFieldMetadataListsConcreteComponentReferenceFields:MonoScriptRuntimeTest.ClassFieldDefaultValueQueryReturnsNullComponentReferences:MonoScriptRuntimeTest.ComponentReferenceFieldsApplyStoredValuesAndPersistAcrossSceneRoundTrip` 全部通过。
- 扩大回归 `ScriptFieldStorage_Test.*:MonoScriptRuntimeTest.*:ProjectScriptAssemblyTest.*` 日志层面全绿;当前测试进程仍存在历史性的异常退出码现象,需要后续单独跟踪,不是本步引入的问题。
- 字段系统下一步建议切到:资源引用字段,或等 editor Inspector 重构稳定后,再补组件字段的可视化选择器。