From 28b76d72fecd3a2a1b7703633eb207b442a327ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=CC=87lter=20Bilgu=CC=88ven?= Date: Wed, 5 Feb 2025 14:35:22 +0300 Subject: [PATCH 1/2] fix: UnityPickers.AssetPickerDrawer throws exception when fieldInfo is null --- .../Editor/UnityPickers/AssetPickerDrawer.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs index 669dbfc3..f07c195f 100644 --- a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs +++ b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs @@ -10,6 +10,13 @@ public class AssetPickerDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { + if (fieldInfo == null) + { + // If fieldInfo is null, draw the property field as is. + EditorGUI.PropertyField(position, property, label); + return; + } + var assetType = fieldInfo.FieldType; if (assetType.IsUnityCollection()) assetType = assetType.GetElementType(); From 5bc23d2dd1ae9e430f06714990c590f18af812db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=CC=87lter=20Bilgu=CC=88ven?= Date: Wed, 5 Feb 2025 14:51:27 +0300 Subject: [PATCH 2/2] fix: UnityPickers.AssetPickerDrawer throws exception when assetType is null --- .../Editor/UnityPickers/AssetPickerDrawer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs index f07c195f..adf72ef0 100644 --- a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs +++ b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Editor/UnityPickers/AssetPickerDrawer.cs @@ -22,7 +22,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten assetType = assetType.GetElementType(); if (assetType == null) + { + // If assetType is null, draw the property field as is. + EditorGUI.PropertyField(position, property, label); return; + } var a = fieldInfo.GetAttribute();