internal static void Rebuild(Assembly assembly)
{
Type[] typesFromAssembly = AssemblyHelper.GetTypesFromAssembly(assembly);
foreach (Type type in typesFromAssembly)
{
object[] customAttributes = type.GetCustomAttributes(typeof(CustomEditor), false);
foreach (CustomEditor editor in customAttributes)
{
MonoEditorType item = new MonoEditorType();
if (editor.m_InspectedType == null)
{
Debug.Log("Can't load custom inspector " + type.Name + " because the inspected type is null.");
}
else if (!type.IsSubclassOf(typeof(Editor)))
{
if (((type.FullName != "TweakMode") || !type.IsEnum) || (editor.m_InspectedType.FullName != "BloomAndFlares"))
{
Debug.LogWarning(type.Name + " uses the CustomEditor attribute but does not inherit from Editor.\nYou must inherit from Editor. See the Editor class script documentation.");
}
}
else
{
item.m_InspectedType = editor.m_InspectedType;
item.m_InspectorType = type;
item.m_EditorForChildClasses = editor.m_EditorForChildClasses;
item.m_IsFallback = editor.isFallback;
kSCustomEditors.Add(item);
if (type.GetCustomAttributes(typeof(CanEditMultipleObjects), false).Length > 0)
{
kSCustomMultiEditors.Add(item);
}
}
}
}
}