unity 文档翻译

CustomPropertyDrawer

class in UnityEditor

Description

Tells a custom PropertyDrawer or DecoratorDrawer which run-time Serializable class or PropertyAttribute it's a drawer for.

告知哪个Serializable class或者PropertyAttribute(属性)由自定义的 PropertyDrawer(属性绘制者) 或 DecoratorDrawer(装饰绘制者) 绘制属性。

When you make a custom PropertyDrawer or DecoratorDrawer, you need put this attribute on the drawer class. If the drawer is for a Serializable class, then pass the type of the class to the CustomPropertyDrawer attribute (only valid for PropertyDrawers; not DecoratorDrawers). If the drawer is for a PropertyAttribute, then pass the type of the PropertyAttribute to the CustomPropertyDrawer attribute.

当你创建了一个自定义的PropertyDrawer 或 DecoratorDrawer,你需要将绘制的类放上这个字段。如果是绘制Serializable class,那么需要将类的类型传递给CustomPropertyDrawer字段(只容许用在PropertyDrawers上,DecoratorDrawers不行)。如果是绘制PropertyAttribute,那么需要传递PropertyAttribute的类型给CustomPropertyDrawer字段。

 

 

posted @ 2016-12-19 22:27  spzktshow  阅读(139)  评论(0)    收藏  举报