public class NameAttribute : PropertyAttribute
{
public string NewName { get; private set; }
public NameAttribute(string name)
{
NewName = name;
}
}
using UnityEditor;
public class NamePropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
NameAttribute nameAttribute = (NameAttribute)this.attribute;
label.text = nameAttribute.NewName;
EditorGUI.PropertyField(position, property, label );
}
}
public class MyClass : MonoBehaviour
{
[Name("테스트")
public float testValue;
.
.
}