NOTE: Your issue may already be reported! Please search on the issue tracker before creating one.
Describe the bug
There is a null reference exception when using reflection to find the property drawer type.
To Reproduce
Steps to reproduce the behavior:
Import package into Unity v2022.3.24.f1 or above
Console will show an error regarding reflection
It references "PropertyDrawerInjector.cs" line 16
Additional context
The error occurs in the following lines :
private static readonly Type s_TypeDrawerKeySet = Type.GetType("UnityEditor.ScriptAttributeUtility+DrawerKeySet, UnityEditor");
private static readonly FieldInfo s_FiDrawer = s_TypeDrawerKeySet.GetField("drawer", kBfAll);
private static readonly FieldInfo s_FiType = s_TypeDrawerKeySet.GetField("type", kBfAll);
The script tries to get TypeDrawerKeySet in UnityEditor.ScriptAttributeUtility. However in the newer versions of unity this struct does not exist. Therefore it leads to a null reference exception.
I hope you can look into this at your earliest convenience and modify the script accordingly for newer unity versions.
NOTE: Your issue may already be reported! Please search on the issue tracker before creating one.
Describe the bug There is a null reference exception when using reflection to find the property drawer type.
To Reproduce Steps to reproduce the behavior:
Additional context The error occurs in the following lines : private static readonly Type s_TypeDrawerKeySet = Type.GetType("UnityEditor.ScriptAttributeUtility+DrawerKeySet, UnityEditor"); private static readonly FieldInfo s_FiDrawer = s_TypeDrawerKeySet.GetField("drawer", kBfAll); private static readonly FieldInfo s_FiType = s_TypeDrawerKeySet.GetField("type", kBfAll);
The script tries to get TypeDrawerKeySet in UnityEditor.ScriptAttributeUtility. However in the newer versions of unity this struct does not exist. Therefore it leads to a null reference exception.
I hope you can look into this at your earliest convenience and modify the script accordingly for newer unity versions.