Skip to content

Latest commit

 

History

History
116 lines (85 loc) · 3.42 KB

File metadata and controls

116 lines (85 loc) · 3.42 KB

GameFrameX Logo

GameFrameX Image Cache

Version License Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams

Documentation · Quick Start · QQ Group · Language: **English** · 简体中文 · 繁體中文 · 日本語 · 한국어


Project Overview

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 IDownloadManager to disk cache, loads as Texture2D
  • WebGL: Loads images via UnityWebRequestTexture, browser handles caching

Quick Start

Installation

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.

Usage

// 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 Support

Platform Strategy
iOS / Android / Windows / macOS Disk cache via IDownloadManager
WebGL Browser cache via UnityWebRequestTexture

Documentation & Resources

Community & Support

Changelog

See Releases for changelog.

License

See LICENSE.md for license information.