CustomEditor 自定义编辑器

Inherits from System.Attribute

Tells an Editor class which run-time type it's an editor for.

描述了用于编辑器实时运行类型的一个编辑器类。

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
 注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。

When you make a custom editor for a component, you need put this attribute on the editor class.

当你为一个组件制作一个自定义编辑器时,你需要带上这个属性编辑器类。

参见:Editor 类.

Constructors构造器

  • CustomEditor
    Defines which object type the custom editor class can edit.
          定义了对象类型的自定义编辑器类可以编辑。
,