- Home /
Question by
Jehy · Jul 08, 2018 at 05:58 AM ·
editorinspectoreditor-scriptingeditorgui
Custom Inspector Color Spacer
I'm trying to create a colored divider in my custom inspector.
I found this: https://docs.unity3d.com/ScriptReference/DecoratorDrawer.html
But the resulting texture is always white. I'm using the exact copy pasted code from the documentation. The color should be Color(1, 0, 0). What's going wrong?
capture.png
(17.0 kB)
Comment
Best Answer
Answer by Jehy · Jul 08, 2018 at 06:22 AM
I was able to achieve the desired result by using:
Color color = new Color(1, 0, 0);
Rect p = position;
EditorGUI.DrawRect(new Rect(p.x-11, p.y, p.width+11, p.height-2), color);
capture.png
(17.4 kB)