public static void FindUnusedAssets() { string title = "Find unused files?"; string message = "Press 'OK' to launch a build setting dialog to start a build.\r\n\r\n"; if (EditorUtility.DisplayDialog(title, message, "OK", "Cancel")) { EditorWindow.GetWindow(System.Type.GetType("UnityEditor.BuildPlayerWindow,UnityEditor")); } APCache.SaveToLocal(); EditorPrefs.SetString(APCache.LOAD_FROM_LOCAL_KEY, APCache.LOAD_FROM_LOCAL_KEY); }
private static void CheckUnusedState() { Utility.DebugLog("CheckUnusedState"); var markFile = AssetsUsageChecker.GetMarkFile(); if (File.Exists(markFile)) { List <string> assets = AssetsUsageChecker.Check(); if (assets != null && assets.Count > 0) { HashSet <string> usedFiles = new HashSet <string>(); foreach (var item in assets) { usedFiles.Add(item); } APCache.UpdateUsedStatus(usedFiles); APCache.SaveToLocal(); File.WriteAllText(AFTERBUILD_A_PLUS, string.Empty); } File.Delete(markFile); } }
private static void CheckUnusedState() { Utility.DebugLog("CheckUnusedState"); string key = AssetsUsageChecker.GetUniqueAssetCheckerKey(); Utility.DebugLog("Checking key: " + key + ", with result = " + EditorPrefs.HasKey(key)); if (EditorPrefs.HasKey(key)) { List <string> assets = AssetsUsageChecker.Check(); if (assets != null && assets.Count > 0) { HashSet <string> usedFiles = new HashSet <string>(); foreach (var item in assets) { usedFiles.Add(item); } APCache.UpdateUsedStatus(usedFiles); APCache.SaveToLocal(); EditorPrefs.SetString(AFTERBUILD_A_PLUS, AFTERBUILD_A_PLUS); EditorPrefs.DeleteKey(AssetsUsageChecker.GetUniqueAssetCheckerKey()); } } }