[Unity 3d] Inspector Reorderable-List(可排序列表) - GitHub

GitHub 上的工程多如繁星,有些好的仓库,但凡不经意间错过了就很难找回,故稍作采撷,希望能帮助到有心人。
本文集以一个小的功能点为单位行文,也便于拾取罢!

简介:

笔者今天推荐的仓库叫 Reorderable-List ,可排序列表 。
这是一个集 UnityEditor Inspector美化和 功能扩展于一身组件,实现了列表的 自由排序,自由删除任意元素,解决了常规序列化List元素固化无法删减排序的痛点。
使用Treeview结构的数据测试最多支持4级嵌套,如果有能力可以自定义。

演示

3600713-00289155ecd33ddf.png
转载,侵立删

功能:

  • Drag and Drop references (like array inspector) - 支持引用类型数据直接拖放
  • Expandable items and list itself - 支持扩展自身及子项
  • Multiple selection (ctrl/command, shift select) - 支持按 ctrl/shift 多选
  • Draggable selection - 可拖拽选择
  • Context menu items (revert values, duplicate values, delete values) - 拓展上下文菜单(支持翻转数据,复制/删除数据)
  • Custom attribute which allows automatic list generation for properties* - 支持自定义属性
  • Event delegates and custom styling - 具备回调和自定义样式
  • Pagination - 支持列表数据分页
  • Sorting (sort based on field, ascending and descending) - 支持基于字段的正/逆序排序
  • Surrogates (Enable adding elements of a different type) - 支持将不同的(自定义)类型作为子项添加

链接:

cfoulston/Unity-Reorderable-List:

结语:

常规 List/Array 只能在队列尾部移除或新增的痛点完美解决,同时也解决了 Unity原生 Reorderable 没有折叠功能的痛点
结合 Unity 原生 ScriptableObject 味道不知道有多美,哈哈!!

扩展阅读:

笔者遇到的类似功能的其他仓库在本文一并给出吧:

  1. SubjectNerd-Unity/ReorderableInspector: Automatic reorderable lists for Unity game engine components
    3600713-dafe7220865f02bd.png
    转载,侵立删

    Tips:他是直接嵌入Inspector,喜欢这种简约效果的可以一试。
  2. rotorz/unity3d-reorderable-list: List control for Unity allowing editor developers to add reorderable list controls to their GUIs.
    3600713-d67d2fac478ce411.png
    image.png

本文集持续更新ing

猜你喜欢

转载自blog.csdn.net/weixin_33913377/article/details/90935455