private static void CheckUsedUpdate() { var markFile = AssetsUsageChecker.GetMarkFile(); if (File.Exists(markFile)) { if (!APCache.LoadFromLocal()) { APCache.LoadDataIntoCache(CheckUnusedState); } else { CheckUnusedState(); } } if (File.Exists(AFTERBUILD_A_PLUS)) { if (APlusWindow.Instance != null && APlusWindow.Instance.webview != null && AssetNotification.webCommunicationService != null) { AssetNotification.webCommunicationService.RefreshAll(); AssetNotification.webCommunicationService.Refresh(); File.Delete(AFTERBUILD_A_PLUS); } } }
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()); } } }