- Home /
EditorGUILayout for GUIStyle
Hi.
What would you use for showing GUIStyle in the OnInspectorGUI of a custom editor?
I tried this and it gives me an error about not being able to convert GUIStyle to UnityEngine.Object
style = (GUIStyle)EditorGUILayout.ObjectField("Style", (UnityEngine.Object)style, typeof(GUIStyle));
This is the 1st comunity post asking this question and I was sad to see there is no answer and it was asked quite awhile ago. I am wanting to change the justification from center to left on the default style, but it wont let me do much when the script is in the editor folder. here is my issue, in the attached pic, with the inspector at a normal needed width the items on beginhorziontal are way off the screen, and only get worse as you slide the window larger, becaue of the middle center textanchor alignment spent a few hours now trying to fix it. i could get it workin on any gui item that is in the OnGUI method during runtime, but this is for the custom editor layout.
Your answer
Follow this Question
Related Questions
How make EditorGUILayout.ObjectField get a Monobehaviour from the Assets folder 1 Answer
Strange error in EditorGUILayout.ObjectField() 1 Answer
EditorGUILayout size not calculated automatically? 1 Answer
Help with Custom Editor GUIStyle - Loading custom textures from Resources 0 Answers
EditorGUILayout.ObjectField does not allow me to select a script. 1 Answer