Skip to content

Commit 12adde6

Browse files
committed
delete il2cpp cache
1 parent 718cfb3 commit 12adde6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Assets/AndroidIl2cppPatchDemo/Script/VersionSettor.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,21 @@ public void OnClickSetVersion()
2727
if (!string.IsNullOrEmpty(error))
2828
{
2929
messageBox.Show("use failed. empty path error:" + error, "ok", ()=> { messageBox.Close(); });
30+
return;
3031
}
31-
else
32+
33+
string cacheDir = Application.persistentDataPath + "/il2cpp";
34+
if (Directory.Exists(cacheDir))
35+
{
36+
DeleteDirectory(cacheDir);
37+
}
38+
39+
if (Directory.Exists(cacheDir))
3240
{
33-
StartCoroutine(Restart());
41+
messageBox.Show("failed to delete pre Unity cached file. path:" + cacheDir, "ok", () => { messageBox.Close(); });
42+
return;
3443
}
44+
StartCoroutine(Restart());
3545
return;
3646
}
3747
StartCoroutine(PreparePatchAndRestart());

0 commit comments

Comments
 (0)