Closed slavniyteo closed 6 years ago
From decompiled internal UnityEditor.PropertyHandler
:
public void HandleDrawnType(Type drawnType, Type propertyType, FieldInfo field, PropertyAttribute attribute) {
Type drawerTypeForType = ScriptAttributeUtility.GetDrawerTypeForType(drawnType);
if (drawerTypeForType != null) {
if (typeof(PropertyDrawer).IsAssignableFrom(drawerTypeForType)) {
if (propertyType == null || !propertyType.IsArrayOrList()) {
this.m_PropertyDrawer = (PropertyDrawer)Activator.CreateInstance(drawerTypeForType);
this.m_PropertyDrawer.m_FieldInfo = field;
this.m_PropertyDrawer.m_Attribute = attribute;
}
}
}
}
I see now, that PropertyDrawer.FieldInfo exists from Unity 5.0. So we need to move onto this rails.
Associated with #16
We can not use FieldInfo from OneLine drawer, because, we recursively walk through types.
So I set fieldInfo
property for custom drawers of nested fields.
Done with #20.
I need to search about this field.
When I tried to use this field last time, it always was null.
Need to look inside UnityEditor.dll decompiled