I’m trying to work out how to have my textures display in my custom inspector so that they are the same as they are with the standard inspector.
I’m using this code:
B.DisplayTexture = (Texture)EditorGUILayout.ObjectField("Display", B.DisplayTexture, typeof(Texture));
But that gives me a square box, rather than the default. I’ve tried the GUILayout options (like MaxHeight) but they don’t change anything. What should I be using instead?
This is a bit of a guess (I can’t easily check right now to make sure it’s correct), but is this what you’re looking for?
Aha, that’s not quite the one I was looking for, but so close that I couldn’t miss it. The actual function I was looking for was EditorGUIUtility.LooksLikeInspector()
Thanks very much for the help. I was tearing my hair out last night, and it never occurred to me that there would be a matching EditorGUIUtility class, so I was nowhere near finding that on my own.