I’m trying to do a scrollbar for a textarea in a custom editor inspector script, using the following snippet.
[CustomEditor(typeof(WebRequestManager))]
public class WebRequestManagerInspector : Editor
{
Vector2 m_scrollData = Vector2.zero;
public override void OnInspectorGUI()
{
EditorGUILayout.Separator();
EditorGUILayout.LabelField("Serial Data", string.Empty);
GUIStyle horizontalStyle = new GUIStyle();
horizontalStyle.fixedWidth = 400;
GUIStyle verticalStyle = new GUIStyle();
verticalStyle.fixedHeight = 400;
m_scrollData = EditorGUILayout.BeginScrollView(m_scrollData, true, true, horizontalStyle, verticalStyle, new GUIStyle());
EditorGUILayout.TextArea(WebRequestManager.DebugGameState.m_dataContent, horizontalStyle);
EditorGUILayout.EndScrollView();
EditorGUILayout.Separator();
base.OnInspectorGUI();
}
}
The result is that I get an error that the default gui skin is missing some custom styles for:
‘thumb’, ‘leftbutton’, ‘rightbutton’, ‘upbutton’, ‘downbutton’, missing in the inspectorGUISkin.
I can add these custom styles to a new skin. But I don’t have any clue about what the images should look like.
With Unity 3 around the corner, could you put these styles into the default skin?
Thanks a ton. A functional scrollbar for a text area in an inspector would be great.