UnityEditor.MultilineDrawer.OnGUI C# (CSharp) Method

OnGUI() public method

public OnGUI ( Rect position, UnityEditor.SerializedProperty property, GUIContent label ) : void
position UnityEngine.Rect
property UnityEditor.SerializedProperty
label UnityEngine.GUIContent
return void
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (property.propertyType == SerializedPropertyType.String)
            {
                label = EditorGUI.BeginProperty(position, label, property);
                position = EditorGUI.MultiFieldPrefixLabel(position, 0, label, 1);
                EditorGUI.BeginChangeCheck();
                int indentLevel = EditorGUI.indentLevel;
                EditorGUI.indentLevel = 0;
                string str = EditorGUI.TextArea(position, property.stringValue);
                EditorGUI.indentLevel = indentLevel;
                if (EditorGUI.EndChangeCheck())
                {
                    property.stringValue = str;
                }
                EditorGUI.EndProperty();
            }
            else
            {
                EditorGUI.LabelField(position, label.text, "Use Multiline with string.");
            }
        }
    }