feat: 新增 UITKModule — 基于 UI Toolkit 的完整 UI 框架模块#270
Open
vvgool wants to merge 44 commits into
Open
Conversation
…lBase, converters
…e-SourceGenerator)
… add Unity meta files
…how/HideAnimation to internal virtual
… TwoWay, Command, Widget, Animation
…ditor pre-generation
…(UITKBindingGenerator)
…lopers no longer call manually
…ption and no-sound support
…enerated binding code
…, unified global handler
…le, uitk-binding, uitk-mvvm)
绑定生成器从「运行时反射 + 易泄漏 lambda」改为编译期生成对 UITKBase.Bind* helper 的调用,订阅/解绑使用同一委托实例,杜绝 `-= 新lambda` 永不解绑导致的内存泄漏。 主要改动: - UITKBase 新增 BindLabel/BindField(同类型/converter)/BindCommand 运行时 helper,统一登记解绑动作;移除旧 BindContext/UnbindContext。 - 生成器解析唯一 ViewModel 字段,按控件类型×属性类型×mode×converter 选择绑定方式,类型不匹配/路径无效时编译期报错并跳过。 - 生命周期:OnCreate(构造 VM) 后自动 __UITKAutoBindMVVM, OnDestroy 前自动 __UITKAutoUnbindMVVM。 - VM 为 null 时输出 Warning 日志而非静默跳过,便于排查。 健壮性修复: - Window/Widget/ListView 资源加载失败改为 try/catch + 返回 null, Window 弹栈回滚,避免 NRE 与卡死在栈中。 - 关闭动画期间被重新 Show 的竞态:新增 IsClosing 标志 + 动画后二次校验。 - InternalDestroy 幂等守卫,防止动画期间重复销毁。 - BindableList.AddRange/Clear 逐项触发增删事件;Clear 逆序保证 index 有效。 - BindableProperty 隐式转换 null 安全。 - UITKResourceLoader 改用 GameModule.Resource 统一访问。 新增 TestMvvmAutoBindWindow 全自动绑定测试(OneWay+format、TwoWay 同类型、 TwoWay+converter、命令),并同步更新 uitk-* 参考文档。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
|
感谢PR,东西很不错,但UIToolKit比较小众 用的人确实少,这边建议先PR到仓库 TEngine.Extension https://github.com/Alex-Rachel/TEngine.Extension 后续等UIToolKit成熟后在并回主仓库。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 TEngine 新增基于 Unity UI Toolkit 的完整 UI 模块(UITKModule),与现有 UIModule (UGUI) 并行共存。
核心特性
[Q]+[OnClick]+[OnChange]Attribute,Editor 菜单生成.bindgen.csno-soundclass 静音使用示例
文件结构
兼容性
GameModule.UITK访问新模块文档
docs/superpowers/specs/2026-06-11-uitk-module-design.md.claude/skills/tengine-dev/references/uitk-*.md