private static string GetSettingTemplateFileName(Type importerType) { Type configuratorType = GetConfiguratorTypeFor(importerType); CustomAssetImporterConfigurator attr = configuratorType.GetCustomAttributes(typeof(CustomAssetImporterConfigurator), false).FirstOrDefault() as CustomAssetImporterConfigurator; if (attr != null) { return(attr.TemplateFileName); } return(null); }
public static Dictionary <string, Type> GetImporterConfiguratorGuiNameTypeMap() { if (s_importerConfiguratorGuiNameTypeMap == null) { var map = new Dictionary <string, Type> (); var allConfigurators = new List <Type> (); foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { var types = assembly.GetTypes() .Where(t => t != typeof(IAssetImporterConfigurator)) .Where(t => typeof(IAssetImporterConfigurator).IsAssignableFrom(t)); allConfigurators.AddRange(types); } foreach (var type in allConfigurators) { CustomAssetImporterConfigurator attr = type.GetCustomAttributes(typeof(CustomAssetImporterConfigurator), false).FirstOrDefault() as CustomAssetImporterConfigurator; if (attr != null) { if (!map.ContainsKey(attr.GUIName)) { map [attr.GUIName] = attr.For; } else { LogUtility.Logger.LogWarning(LogUtility.kTag, $"Multiple CustomImporterConfigurator for {attr.For.Name} found. Ignoring {type.Name}"); } } } s_importerConfiguratorGuiNameTypeMap = map; } return(s_importerConfiguratorGuiNameTypeMap); }