private void ApplyFiter() { dirty = false; refs = new Dictionary <string, FR2_Ref>(); foreach (KeyValuePair <string, List <string> > item in FR2_Setting.IgnoreFiltered) { foreach (string item2 in item.Value) { string guid = AssetDatabase.AssetPathToGUID(item2); if (string.IsNullOrEmpty(guid)) { continue; } FR2_Asset asset = FR2_Cache.Api.Get(guid, true); var r = new FR2_Ref(0, 0, asset, null, item.Key); refs.Add(guid, r); } } groupIgnore.Reset ( refs.Values.ToList(), rf => rf.asset != null ? rf.asset.guid : "", GetGroup, SortGroup ); }
public void RefreshSort() { if (list == null) { return; } if (list.Count > 0 && list[0].isSceneRef == false && FR2_Setting.SortMode == Sort.Size) { list = list.OrderByDescending(x => x.asset.fileSize).ToList(); } else { list.Sort((r1, r2) => { if (r1.isSceneRef && r2.isSceneRef) { var rs1 = r1 as FR2_SceneRef; var rs2 = r2 as FR2_SceneRef; if (rs1 != null && rs2 != null) { return(SortAsset(rs1.sceneFullPath, rs2.sceneFullPath, rs1.targetType, rs2.targetType, FR2_Setting.SortMode == Sort.Path)); } } if (r1.isSceneRef) { return(0); } if (r2.isSceneRef) { return(1); } int v = string.IsNullOrEmpty(searchTerm) ? 0 : r2.matchingScore.CompareTo(r1.matchingScore); if (v != 0) { return(v); } return(SortAsset( r1.asset.assetPath, r2.asset.assetPath, r1.asset.extension, r2.asset.extension, FR2_Setting.SortMode == Sort.Path )); }); } //folderDrawer.GroupByAssetType(list); groupDrawer.Reset(list, rf => rf.isSceneRef ? rf.GetSceneObjId() : rf.asset.guid , GetGroup, SortGroup); }
private void ResetGroup() { //folderDrawer.GroupByAssetType(list); groupDrawer.Reset(list, rf => rf.asset.guid , GetGroup, SortGroup); if (window != null) { window.Repaint(); } }