Change: CreateListViewFromSettingsAttribute -> CreateListViewFromFieldInfo

This commit is contained in:
AnnulusGames 2024-02-21 10:01:29 +09:00
parent 0d1063b13a
commit 18ccff10cb
2 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,7 @@ namespace Alchemy.Editor.Elements
var settings = property.GetAttribute<ListViewSettingsAttribute>(true);
var listView = GUIHelper.CreateListViewFromSettingsAttribute(settings);
var listView = GUIHelper.CreateListViewFromFieldInfo(property.GetFieldInfo());
listView.headerTitle = ObjectNames.NicifyVariableName(property.displayName);
listView.bindItem = (element, index) =>
{

View File

@ -1,10 +1,11 @@
using System;
using System.Reflection;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.Assertions;
using Alchemy.Inspector;
using System;
namespace Alchemy.Editor
{
@ -51,8 +52,9 @@ namespace Alchemy.Editor
};
}
public static ListView CreateListViewFromSettingsAttribute(ListViewSettingsAttribute settings)
public static ListView CreateListViewFromFieldInfo(FieldInfo fieldInfo)
{
var settings = fieldInfo.GetCustomAttribute<ListViewSettingsAttribute>();
return new ListView
{
reorderable = settings == null ? true : settings.Reorderable,