We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So with [AllowNesting] a CustomPropertyDrawer of nested classes seems to be ignored.
I fixed it by:
a) Downloading the script from here that would lookup the correct drawer: https://forum.unity.com/threads/solved-custompropertydrawer-not-being-using-in-editorgui-propertyfield.534968/ https://gist.github.com/wappenull/2391b3c23dd20ede74483d0da4cab3f1
b) Fixed a reflection issue with serialized private fields in that PropertyDrawerFinder.cs script in around line 120 by adding binding flags:
[...] else { fi = resolvedType.GetField( fullPath[i], BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly ); resolvedType = fi.FieldType; } [...]
c) Edited the AllowNestingPropertyDrawer.cs to this:
public class AllowNestingPropertyDrawer : PropertyDrawerBase { protected override void OnGUI_Internal(Rect rect, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(rect, label, property); //EditorGUI.PropertyField(rect, property, label, true); PropertyDrawer propertyDrawer = PropertyDrawerFinder.FindDrawerForProperty(property); if (propertyDrawer == null) { EditorGUI.PropertyField(rect, property, label, true); } else { propertyDrawer.OnGUI(rect, property, label); } EditorGUI.EndProperty(); } protected override float GetPropertyHeight_Internal(SerializedProperty property, GUIContent label) { PropertyDrawer cust = PropertyDrawerFinder.FindDrawerForProperty(property); if (cust != null) { return cust.GetPropertyHeight(property, label); } else { return base.GetPropertyHeight_Internal(property, label); } } }
I don't feel competent enough in editor scripting to judge if this is a solid fix but I still wanted to share it.
Before:
After:
The text was updated successfully, but these errors were encountered:
I'm running into this issue too. If there's a fork out there with this fix, I'd use it!
Sorry, something went wrong.
No branches or pull requests
So with [AllowNesting] a CustomPropertyDrawer of nested classes seems to be ignored.
I fixed it by:
a) Downloading the script from here that would lookup the correct drawer:
https://forum.unity.com/threads/solved-custompropertydrawer-not-being-using-in-editorgui-propertyfield.534968/
https://gist.github.com/wappenull/2391b3c23dd20ede74483d0da4cab3f1
b) Fixed a reflection issue with serialized private fields in that PropertyDrawerFinder.cs script in around line 120 by adding binding flags:
c) Edited the AllowNestingPropertyDrawer.cs to this:
I don't feel competent enough in editor scripting to judge if this is a solid fix but I still wanted to share it.
Before:
After:
The text was updated successfully, but these errors were encountered: