Last active
November 18, 2015 08:16
-
-
Save fumobox/8040e945f71f79cd4020 to your computer and use it in GitHub Desktop.
CacheManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using System.IO; | |
using System.Collections; | |
public static class CacheManager { | |
[UnityEditor.MenuItem("Cache/Clear Caches")] | |
public static void Clear() { | |
Debug.LogWarning("Delete " + Application.persistentDataPath); | |
Directory.Delete(Application.persistentDataPath, true); | |
PlayerPrefs.DeleteAll(); | |
if (Caching.CleanCache ()) | |
{ | |
Debug.LogWarning ("Clear cache: success"); | |
} | |
else | |
{ | |
Debug.LogWarning ("Clear cache: failed"); | |
} | |
} | |
[UnityEditor.MenuItem("Cache/Clear PlayerPrefs")] | |
public static void ClearPlayerPrefs() | |
{ | |
PlayerPrefs.DeleteAll(); | |
} | |
[UnityEditor.MenuItem("Cache/Open PersistentDataPath")] | |
public static void OpenPersistentDataPath() | |
{ | |
OpenInFileBrowser.Open(Application.persistentDataPath); | |
} | |
[UnityEditor.MenuItem("Cache/Open DataPath")] | |
public static void OpenDataPath() | |
{ | |
OpenInFileBrowser.Open(Application.dataPath); | |
} | |
[UnityEditor.MenuItem("Cache/Open TemporaryCachePath")] | |
public static void OpenTemporaryCachePath() | |
{ | |
OpenInFileBrowser.Open(Application.temporaryCachePath); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment