官方文档里的 CustomEditor函数
namespace UnityEditor
{
//
// 摘要:
// Tells an Editor class which run-time type it's an editor for.
public class CustomEditor : Attribute
{
//
// 摘要:
// Defines which object type the custom editor class can edit.
//
// 参数:
// inspectedType:
// Type that this editor can edit.
//
// editorForChildClasses:
// If true, child classes of inspectedType will also show this editor. Defaults
// to false.
public CustomEditor(Type inspectedType);
//
// 摘要:
// Defines which object type the custom editor class can edit.
//
// 参数:
// inspectedType:
// Type that this editor can edit.
//
// editorForChildClasses:
// If true, child classes of inspectedType will also show this editor. Defaults
// to false.
public CustomEditor(Type inspectedType, bool editorForChildClasses);
//
// 摘要:
// If true, match this editor only if all non-fallback editors do not match. Defaults
// to false.
public bool isFallback {
get; set; }
}
}
CustomEditor有两个,调用第二个函数时第二个值为true就可以啦