diff --git a/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs b/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs index e03bf84..5305bce 100644 --- a/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs +++ b/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs @@ -82,6 +82,7 @@ namespace Alchemy.Editor.Elements PropertyField propertyField => propertyField.label, SerializeReferenceField serializeReferenceField => serializeReferenceField.foldout.text, InlineEditorObjectField inlineEditorObjectField => inlineEditorObjectField.Label, + PropertyListView propertyListView => propertyListView.Label, _ => null, }; } @@ -101,7 +102,10 @@ namespace Alchemy.Editor.Elements case InlineEditorObjectField inlineEditorObjectField: inlineEditorObjectField.Label = value; break; - }; + case PropertyListView propertyListView: + propertyListView.Label = value; + break; + } } } } diff --git a/Alchemy/Assets/Alchemy/Editor/Elements/PropertyListView.cs b/Alchemy/Assets/Alchemy/Editor/Elements/PropertyListView.cs index b7298c8..2373478 100644 --- a/Alchemy/Assets/Alchemy/Editor/Elements/PropertyListView.cs +++ b/Alchemy/Assets/Alchemy/Editor/Elements/PropertyListView.cs @@ -19,7 +19,7 @@ namespace Alchemy.Editor.Elements var parentObj = property.GetDeclaredObject(); var events = property.GetAttribute(true); - var listView = GUIHelper.CreateListViewFromFieldInfo(parentObj, property.GetFieldInfo()); + listView = GUIHelper.CreateListViewFromFieldInfo(parentObj, property.GetFieldInfo()); listView.headerTitle = ObjectNames.NicifyVariableName(property.displayName); listView.bindItem = (element, index) => { @@ -48,5 +48,13 @@ namespace Alchemy.Editor.Elements listView.BindProperty(property); Add(listView); } + + readonly ListView listView; + + public string Label + { + get => listView.headerTitle; + set => listView.headerTitle = value; + } } } \ No newline at end of file diff --git a/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity b/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity index 7b91661..f0c2923 100644 --- a/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity +++ b/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity @@ -1085,6 +1085,12 @@ MonoBehaviour: foo: 0 bar: {x: 0, y: 0, z: 0} baz: {fileID: 0} + fooList: + - 0 + barList: + - {x: 0, y: 0, z: 0} + bazList: + - {fileID: 0} --- !u!1 &801201066 GameObject: m_ObjectHideFlags: 0 diff --git a/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/Decorations/LabelTextSample.cs b/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/Decorations/LabelTextSample.cs index ee97e68..2230e74 100644 --- a/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/Decorations/LabelTextSample.cs +++ b/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/Decorations/LabelTextSample.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using UnityEngine; using Alchemy.Inspector; @@ -8,5 +9,9 @@ namespace Alchemy.Samples [LabelText("FOO!")] public float foo; [LabelText("BAR!")] public Vector3 bar; [LabelText("BAZ!")] public GameObject baz; + + [LabelText("FOO LIST!")] public List fooList; + [LabelText("BAR LIST!")] public List barList; + [LabelText("BAZ LIST!")] public List bazList; } }