UnityEditor.TextAreaDrawer.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);
                Rect labelPosition = position;
                labelPosition.height = 16f;
                position.yMin += labelPosition.height;
                EditorGUI.HandlePrefixLabel(position, labelPosition, label);
                EditorGUI.BeginChangeCheck();
                string str = EditorGUI.ScrollableTextAreaInternal(position, property.stringValue, ref this.m_ScrollPosition, EditorStyles.textArea);
                if (EditorGUI.EndChangeCheck())
                {
                    property.stringValue = str;
                }
                EditorGUI.EndProperty();
            }
            else
            {
                EditorGUI.LabelField(position, label.text, "Use TextAreaDrawer with string.");
            }
        }
    }