All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
Documentation · Quick Start · QQ Group · Language: **English** · 简体中文 · 繁體中文 · 日本語 · 한국어
GameFrameX.ImageCache is the image caching component for the GameFrameX framework. It provides remote image downloading and disk caching for Unity projects. Images are cached on disk using MD5-based filenames, with configurable cache path and extensible support for max disk size and expiry.
Platform Support:
- Non-WebGL: Downloads images via
IDownloadManagerto disk cache, loads asTexture2D - WebGL: Loads images via
UnityWebRequestTexture, browser handles caching
Edit your Unity project's Packages/manifest.json and add the scopedRegistries section:
{
"scopedRegistries": [
{
"name": "GameFrameX",
"url": "https://gameframex.upm.alianblank.uk",
"scopes": [
"com.gameframex"
]
}
]
}Then add the package to dependencies:
{
"dependencies": {
"com.gameframex.unity.imagecache": "0.0.1"
}
}scopes controls which packages are resolved through this registry. Only packages whose names start with com.gameframex will be fetched from it.
// Get the ImageCache component
var imageCache = GameEntry.GetComponent<ImageCacheComponent>();
// Load a remote image asynchronously
Texture2D texture = await imageCache.LoadImageAsync("https://example.com/image.png");
// Check if an image is cached
bool cached = imageCache.IsCached("https://example.com/image.png");
// Remove a specific cached image
imageCache.RemoveCache("https://example.com/image.png");
// Clear all cached images
imageCache.ClearCache();| Platform | Strategy |
|---|---|
| iOS / Android / Windows / macOS | Disk cache via IDownloadManager |
| WebGL | Browser cache via UnityWebRequestTexture |
- QQ Group: Join
See Releases for changelog.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
