public void SearchAssets(IEnumerable <string> assetGuids, SearchType newSearchType) { Dictionary <string, ElementSource> targets; Dictionary <string, ElementSource> searches; ElementBuilder builder; switch (newSearchType) { case SearchType.kTracePrecedents: { Search.TracePrecedents(assetGuids, recursive, out targets, out searches); break; } case SearchType.kTraceDependents: { Search.TraceDependents(assetGuids, recursive, out targets, out searches); break; } case SearchType.kCheckMissing: { Search.CheckMissing(assetGuids, out targets, out searches); break; } default: { return; } } builder = new ElementBuilder(); foreach (var found in searches) { builder.Append(found.Value); } search.Apply(builder.ToList()); search.ExpandAll(); builder = new ElementBuilder(); foreach (var trace in targets) { builder.Append(trace.Value); } target.Apply(builder.ToList()); target.ExpandAll(); targetGuids = assetGuids.ToArray(); searchType = newSearchType; }
List <Element> GetAllAssetElements() { var paths = AssetDatabase.GetAllAssetPaths(); var builder = new ElementBuilder(); if (paths != null) { for (int i0 = 0; i0 < paths.Length; ++i0) { builder.Append(paths[i0]); } } return(builder.ToList()); }