private static int SortNoUsedAssetsInfo(UnloadAssetInfo x, UnloadAssetInfo y) { //自资源废弃到现在的时间 / 资源使用次数 float freqX = x.GetFrequency(); float freqY = y.GetFrequency(); if (freqX < freqY) { return(1); } else if (freqX > freqY) { return(-1); } return(0); }
private void DrawUnloadAssets() { GUILayout.Space(4); EditorDrawGUIUtil.DrawScrollView(this, () => { List <UnloadAssetInfo> assetList = AssetsUnloadHandler.noUsedAssetsList; for (int i = 0; i < assetList.Count; i++) { UnloadAssetInfo item = assetList[i]; if (!string.IsNullOrEmpty(bundleSearchValue)) { if (!item.assetsName.Contains(bundleSearchValue.ToLower())) { continue; } } EditorDrawGUIUtil.DrawFoldout(item, "(" + item.useTimes + ")" + item.assetsName + "(" + item.GetFrequency() + ")", () => { DrawAssetsData(i, item.assets); }); } }, "box"); }