I'm trying to replicate the Material ObjectField seen in the Inspector, except that I also want to view the material modifications to the texture. I've got everything working except for the Select button, which needs to open an Object Picker window. I cannot figure out how to open this window without using the default ObjectField class, which I can't use because it doesn't offer an equivalent to EditorGUI.DrawPreviewTexture().
What I've tried (unsuccessfully) thus far:
- Resizing the ObjectField to fit in
that small "Select" rectangle
- Manually opening the ObejectPicker
window:
EditorWindow.GetWindow(typeof(ObjectSelector), true, "Object Picker", true);
I guess ObjectSelector is hiding somewhere, because I can't seem to figure out what it inherits from.
↧