예제 #1
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        RenameAttribute rename = (RenameAttribute)attribute;

        label.text = rename.mName;
        EditorGUI.PropertyField(position, property, label);
    }
예제 #2
0
 static string GetItemAttributeText(Type attributeType, Type itemType, RenameAttribute renameRule)
 {
     string originalItemTypeName = itemType.GetNonGenericName();
     string xmlItemTypeName = renameRule != null ? renameRule.Rename(originalItemTypeName) : originalItemTypeName;
     return
         new AttributeBuilder(attributeType.FullName)
         .AddStringParam(xmlItemTypeName)
         .AddTypeParam(originalItemTypeName)
         .ToString();
 }
예제 #3
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        //替换属性名称
        RenameAttribute rename = (RenameAttribute)attribute;

        label.text = rename.name;

        //重绘GUI
        SerializedPropertyType type = property.propertyType;

        if (type == SerializedPropertyType.Enum)
        {
            redrawEnums(position, property, label);
        }
        else
        {
            EditorGUI.PropertyField(position, property, label);
        }
    }