浏览代码

FIxed ReorderableList

/main
Thomas ICHÉ 5 年前
当前提交
65f6c403
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 11
      NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs

11
NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs


drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
{
var element = property.GetArrayElementAtIndex(index);
rect.y += 1.0f;
rect.x += 10.0f;
rect.width -= 10.0f;
if(element.hasChildren)
{
rect.y += 1.0f;
rect.x += 10.0f;
rect.width -= 10.0f;
}
EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, 0.0f), element, true);
EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, true);
},
elementHeightCallback = (int index) =>

正在加载...
取消
保存