From ac6c5e23ee1b257ba8aff7e25e146e6ffc1eb6f7 Mon Sep 17 00:00:00 2001 From: moz-moz <130175603+moz-moz@users.noreply.github.com> Date: Thu, 2 May 2024 22:50:50 +0900 Subject: [PATCH 1/2] fix: RectOffset not being drawn in Inspector --- Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs b/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs index d4959a2..ce9bb8b 100644 --- a/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs +++ b/Alchemy/Assets/Alchemy/Editor/Elements/AlchemyPropertyField.cs @@ -17,6 +17,8 @@ public AlchemyPropertyField(SerializedProperty property, Type type, bool isArray switch (property.propertyType) { + // NOTE: RectOffset is a generic property type, but it doesn't have a SerializeField. Instead, use PropertyField. + case SerializedPropertyType.Generic when property.type == "RectOffset": default: element = new PropertyField(property); break; From dff264d672fdb5284ba6d3af35fdc7757881147a Mon Sep 17 00:00:00 2001 From: moz-moz <130175603+moz-moz@users.noreply.github.com> Date: Thu, 2 May 2024 22:58:57 +0900 Subject: [PATCH 2/2] feat: add RectOffset field to Samples --- Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity | 5 +++++ .../Alchemy/Samples~/Samples/Scripts/General/OrderSample.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity b/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity index f0c2923..e6d020c 100644 --- a/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity +++ b/Alchemy/Assets/Alchemy/Samples~/Samples/Samples.unity @@ -2055,6 +2055,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 10a01c03cb52744d29a15035954b9bd2, type: 3} m_Name: m_EditorClassIdentifier: + qux: + m_Left: 1 + m_Right: 2 + m_Top: 3 + m_Bottom: 4 foo: 0 bar: {x: 0, y: 0, z: 0} baz: {fileID: 0} diff --git a/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/General/OrderSample.cs b/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/General/OrderSample.cs index 92a11d8..734b4fd 100644 --- a/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/General/OrderSample.cs +++ b/Alchemy/Assets/Alchemy/Samples~/Samples/Scripts/General/OrderSample.cs @@ -5,6 +5,7 @@ namespace Alchemy.Samples { public class OrderSample : MonoBehaviour { + [Order(3)] public RectOffset qux; [Order(2)] public float foo; [Order(1)] public Vector3 bar; [Order(0)] public GameObject baz;