Skip to content

Commit 0fa4ad4

Browse files
committed
Remove sub-folders in cache folder but not files
1 parent 9f1b1ae commit 0fa4ad4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Assets/RuntimeSpriteSheetsGenerator/Scripts/AssetPacker/AssetPacker.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ protected IEnumerator createPack(string savePath = "") {
6262
if (savePath != "") {
6363

6464
if (deletePreviousCacheVersion && Directory.Exists(Application.persistentDataPath + "/AssetPacker/" + cacheName + "/"))
65-
Directory.Delete(Application.persistentDataPath + "/AssetPacker/" + cacheName + "/", true);
65+
foreach (string dirPath in Directory.GetDirectories(Application.persistentDataPath + "/AssetPacker/" + cacheName + "/", "*", SearchOption.AllDirectories))
66+
Directory.Delete(dirPath, true);
6667

6768
Directory.CreateDirectory(savePath);
6869
}

0 commit comments

Comments
 (0)