Skip to content

Instantly share code, notes, and snippets.

@kimsama
Last active November 26, 2019 18:58
Show Gist options
  • Save kimsama/5530104 to your computer and use it in GitHub Desktop.
Save kimsama/5530104 to your computer and use it in GitHub Desktop.
Unity editor script which deletes internal editor cache info related asset bundle. Put this script file under an Editor folder.
using UnityEngine;
using UnityEditor;
using System.Collections;
/// <summary>
/// An editor script which deletes cache info.
///
/// NOTE:
/// Delete all AssetBundle content that has been cached by the current application.
/// This function is not available to WebPlayer applications that use the shared cache.
///
/// See Also:
/// http://docs.unity3d.com/Documentation/ScriptReference/Caching.CleanCache.html
///
/// </summary>
public class CacheTools : ScriptableObject
{
[MenuItem ("Tools/Cache/Clean")]
public static void CleanCache ()
{
if (Caching.CleanCache ())
{
Debug.LogWarning ("Successfully cleaned all caches.");
}
else
{
Debug.LogWarning ("Cache was in use.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment