Hi,
I am doing a mini inspector under a object field to quickly show the values of a scriptable object.

The problem is, if I don’t create a custom inspector here is what I have:
In this video, it is said that if that if the inspector element does not find a custom editor, it will show the default one but it is not the case.
Time code: 7min 35
Hello,
Which version of the editor are you using?
I am using Unity 2022.3.6f1
Please also let me know the time code, for some reason the video starts at 00:00 for me! Thank you.
Could you send a snippet of your InspectorElement code?
public class ObjectInspector : ObjectCSCC {
public new class UxmlFactory : UxmlFactory<ObjectInspector, UxmlTraits> { }
Toggle toggleDisplay;
VisualElement inspector;
public ObjectInspector()
{
InitFields();
InitCallbacks();
}
#region Init
void InitFields()
{
toggleDisplay = new Toggle();
toggleDisplay.style.marginLeft = 5;
toggleDisplay.tooltip = "Show values";
ElementAt(0).Add(toggleDisplay);
inspector = new VisualElement();
inspector.name = "inspector";
Add(inspector);
toggleDisplay.Display(false);
UpdateInspector(value);
}
void InitCallbacks()
{
this.RegisterValueChangedCallback(evt =>
{
toggleDisplay.value = evt.newValue != null;
toggleDisplay.Display(evt.newValue != null);
UpdateInspector(evt.newValue);
});
toggleDisplay.RegisterValueChangedCallback(evt =>
{
inspector.Display(evt.newValue);
});
}
#endregion
void UpdateInspector(Object obj)
{
inspector.Clear();
inspector.Display(toggleDisplay.value && obj != null);
if (obj == null) return;
inspector.Add(new InspectorElement(obj));
}
}
ObjectCSCC is a derived class of ObjectField.