private readonly ZeroIndent indentReset; //helper class to reset and restore indentation public FixedWidthLabel(GUIContent label) // constructor. { // state changes are applied here. EditorGUILayout.BeginHorizontal(); // create a new horizontal group EditorGUILayout.LabelField(label, GUILayout.Width(GUI.skin.label.CalcSize(label).x + // actual label width 15 * EditorGUI.indentLevel)); //indentation from the left side. It's 9 pixels per indent level indentReset = new ZeroIndent(); //helper class to have no indentation after the label }
private readonly ZeroIndent indentReset; //helper class to reset and restore indentation #endregion Fields #region Constructors // constructor. public FixedWidthLabel(GUIContent label) { // state changes are applied here. EditorGUILayout.BeginHorizontal();// create a new horizontal group EditorGUILayout.LabelField(label, GUILayout.Width(GUI.skin.label.CalcSize(label).x +// actual label width 15 * EditorGUI.indentLevel));//indentation from the left side. It's 9 pixels per indent level indentReset = new ZeroIndent();//helper class to have no indentation after the label }