Unity 5 CustomEditor for Folders

In Unity 4.6.x it was possible to override the way a folder is displayed by writing a CustomEditor for UnityEngine.Object like shown in this Unite-Presentation: Unite 2014 - The Hack Spectrum: Tips, Tricks and Hacks for Unity - YouTube (starts at 16:17 mins). For those wondering, Buttons and stuff only worked in the OnHeaderGUI(), but not in the OnInspectorGUI() where they were displayed but inaccessible.

Now that I switched from Unity 4.6 to 5.0, the Folders seem to have changed type (they are of type AssetImporter now). On top of that the OnHeaderGUI() and OnInspectorGUI() do not seem to get called at all any more, whereas the OnEnable() and OnDisable() callbacks still work (That’s how I found out about the type change).

Does anyone know a way to get CustomEditors for Folders (fully) working again?

Folders react to [CustomEditor(typeof(DefaultAsset))].

Apparently Unity5 ignores the true part of [CustomEditor(typeof(Object), true)] even though DefaultAsset:Object. Thankfully, folders seem to be DefaultAsset, so [CustomEditor(typeof(DefaultAsset))] actually works to receive the OnHeaderGUI() and OnInspectorGUI() callbacks. OnInspectorGUI() comes pre-disabled, but can be GUI.enabled = true;.

Other assets seem to behave the same way. I cannot get C# scripts to show up for [CustomEditor(typeof(TextAsset), true)] (MonoScript:TextAsset), but I can for [CustomEditor(typeof(MonoScript))]. (Going from this, I looked at all classes deriving Object and guessed DefaultAsset.) I guess you have to know the concrete type of your asset to do custom editors for assets.

P.S. I too thought they would be AssetImporter-derived or something, but they don’t seem to be. AssetImporter stuff uses internal AssetImporterInspector to draw.