Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI System #8

Open
3 of 4 tasks
LovelyCatHyt opened this issue Mar 3, 2022 · 2 comments
Open
3 of 4 tasks

UI System #8

LovelyCatHyt opened this issue Mar 3, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@LovelyCatHyt
Copy link
Owner

LovelyCatHyt commented Mar 3, 2022

具体的需求项目:

类结构: 无法确定, 大部分情况直接在 Inspector 里指定 UnityEvent 也差不多

@LovelyCatHyt LovelyCatHyt self-assigned this Mar 3, 2022
@LovelyCatHyt LovelyCatHyt added the enhancement New feature or request label Mar 4, 2022
LovelyCatHyt added a commit that referenced this issue Mar 16, 2022
LovelyCatHyt added a commit that referenced this issue Mar 18, 2022
#8 20%
顺便改了改脚本的事件接收方式, 用EventSysyem的接口应该也是等效的
LovelyCatHyt added a commit that referenced this issue Mar 19, 2022
#8 30%
由于使用 Text Mesh 实现, 所以还支持 RichText
@LovelyCatHyt
Copy link
Owner Author

目前的 UI 的布局, 依赖 RectTransform 的布局功能基本足够.
利用 Prefab, 还可以很容易地实现 UI 模板, 保证同种 UI 的统一性

一个可能优化的点: 显示结构化的数据时, 仍然需要手动完成"数据绑定"的功能, 可以利用反射一步到位. 另外, 如果暂时不打算构建这个不太简单的系统, 可以直接拿现成的 JObject 来获取属性列表.

另一个硬伤是, 仍缺乏动态显示的 UI 的管理机制, 直接设置 SetActive 似乎太粗暴了. 根据个人使用软件的体验, 计划一个基于栈的 Ui 结构: 点击按钮打开 UI 时, 往 UI 容器栈里添加这个打开的 UI, 而返回按钮, 或者点击画面空白处, 显然就是 Pop 一个元素. 根据栈中元素的有无决定是否暂停游戏/阻断游戏地图上的输入操作(根据具体情况分析哪种更合理)

LovelyCatHyt added a commit that referenced this issue Mar 30, 2022
#8 ListView
完成了简单的带注入的增删操作, 维护了当前选中的目标.
顺便加了个 debug 用的 prefab
@LovelyCatHyt
Copy link
Owner Author

当前选用方案: 为通用的 UI 元素(如 Text)制作 prefab, 保证同种 UI 的统一性. 其它交互功能单独设计, 因为目前几乎不存在多个窗口之间的依赖和控制关系
下一个可以做成 prefab 的 UI:

  • 通用可拖拽窗口. 窗口获取物体中关心窗口事件的组件, 在打开/关闭/拖拽时触发事件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant