Closed DonTomasDeLaVega closed 3 years ago
Very interesting feature you want here! The problem actually is not in ConditionalField. DisplayInspector is made to work with SO or MB field, and CollectionWrapper is not one of those. I'm not sure it'll be possible to make it to work.
Try to use Foldout instead of Conditional! I just reworked it's visual yesterday, it looks neat 🤓
[Foldout("Leaf Creation"), DisplayInspector]
public BookContext[] Contexts;
[Foldout("Leaf Creation"), DisplayInspector]
public Item[] Items;
Ability to use DisplayInspector with collection along with ConditionalField looks nice, I will add it to my to-do, but I'd wouldn't expect it any soon 🙄
btw sorry for the late responce! Abandoned MyBox for a few months with all the crunches with my game 🤯
Here is the issue:
type is not a supported pptr value UnityEditor.SerializedProperty:get_objectReferenceValue () MyBox.Internal.DisplayInspectorAttributeDrawer:OnGUI (UnityEngine.Rect,UnityEditor.SerializedProperty,UnityEngine.GUIContent) (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Attributes/DisplayInspectorAttribute.cs:54) MyBox.Internal.ConditionalFieldAttributeDrawer:<OnGUI>g__TryUseAttributeDrawer|6_0 (MyBox.Internal.ConditionalFieldAttributeDrawer/<>c__DisplayClass6_0&) (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Attributes/ConditionalFieldAttribute.cs:83) MyBox.Internal.ConditionalFieldAttributeDrawer:OnGUI (UnityEngine.Rect,UnityEditor.SerializedProperty,UnityEngine.GUIContent) (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Attributes/ConditionalFieldAttribute.cs:74) UnityEditor.EditorGUILayout:PropertyField (UnityEditor.SerializedProperty,bool,UnityEngine.GUILayoutOption[]) MyBox.Internal.FoldoutAttributeHandler:Body () (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Attributes/FoldoutAttribute.cs:113) MyBox.Internal.FoldoutAttributeHandler:OnInspectorGUI () (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Attributes/FoldoutAttribute.cs:83) MyBox.Internal.UnityObjectEditor:OnInspectorGUI () (at Library/PackageCache/com.domybest.mybox@725b8fb2ca/Tools/Internal/UnityObjectEditor.cs:34) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
It doesn't seem to like it one bit ^^' I can do without, but i'd like to do with it ^^' Here's my code: [...] And when i add, after the conditionnal field, a displayInspector attribute, unity loses its mind