private static void BuildExtendedDrawerTypeMap() { if (extendedDrawerTypeMap != null) { return; } extendedDrawerTypeMap = new Dictionary <Type, Type>(); List <Type> extendedDrawerSubclasses = FindSubClasses <PropertyDrawerX>(); for (int i = 0; i < extendedDrawerSubclasses.Count; i++) { Type drawerType = extendedDrawerSubclasses[i]; object[] attributes = drawerType.GetCustomAttributes(typeof(PropertyDrawerFor), false); for (int j = 0; j < attributes.Length; j++) { PropertyDrawerFor attr = attributes[j] as PropertyDrawerFor; extendedDrawerTypeMap[attr.type] = drawerType; } } }
private static void BuildExtendedDrawerCache() { if (extendedDrawerCache != null) { return; } extendedDrawerCache = new Dictionary <Type, ExtendedPropertyDrawer>(); List <Type> extendedDrawerSubclasses = FindSubClasses <ExtendedPropertyDrawer>(); for (int i = 0; i < extendedDrawerSubclasses.Count; i++) { Type drawerType = extendedDrawerSubclasses[i]; ExtendedPropertyDrawer drawer = Activator.CreateInstance(drawerType) as ExtendedPropertyDrawer; object[] attributes = drawerType.GetCustomAttributes(typeof(PropertyDrawerFor), false); for (int j = 0; j < attributes.Length; j++) { PropertyDrawerFor attr = attributes[j] as PropertyDrawerFor; extendedDrawerCache[attr.type] = drawer; } } }