public static bool HasPropertyDrawer(Type type, Assembly assembly) { if (HasBuiltinPropertyDrawer(type)) { return(true); } if (_propertyDrawerGraph == null) { _propertyDrawerGraph = new PropertyDrawerGraph(); } _propertyDrawerGraph.CreateGraph(assembly); return(_propertyDrawerGraph.HasPropertyDrawer(type)); }
private static void CreatePropertyDrawerGraph() { _propertyDrawerGraph = new PropertyDrawerGraph(); HashSet <string> assemblyNamesToCheck = new HashSet <string>() { "Assembly-CSharp-Editor", }; GetAllAssetDefintionNames(assemblyNamesToCheck); string dataPath = Application.dataPath; string libraryPath = dataPath.Substring(0, dataPath.LastIndexOf('/')) + "/Library/ScriptAssemblies"; foreach (string file in Directory.GetFiles(libraryPath)) { if (assemblyNamesToCheck.Contains(Path.GetFileNameWithoutExtension(file)) && Path.GetExtension(file) == ".dll") { Assembly assembly = Assembly.LoadFrom(file); _propertyDrawerGraph.CreateGraph(assembly); } } }
private static void OnProjectReloaded() { _propertyDrawerGraph = null; }