Синтаксис:
Используется csharp
[Serializable]
public class A
{
public string str;
}
public class A
{
public string str;
}
Есть для него CustomPropertyDrawer:
Синтаксис:
Используется csharp
[CustomPropertyDrawer(typeof(A), true)]
public class A_PropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var str = property.FindPropertyRelative("str");
str.stringValue = EditorGUI.TextField(position, label, str.stringValue);
}
}
public class A_PropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var str = property.FindPropertyRelative("str");
str.stringValue = EditorGUI.TextField(position, label, str.stringValue);
}
}
Вот так он рисует массив, при этом переименовывая элемент в такое же название как строка. Это фича такая? Как избавиться от этой дряни?