https://github.com/coryleach/unityassetcache
Utility classes for caching and unloading assets such like textures
https://github.com/coryleach/unityassetcache
asset assets-management cache downloader package unity unity3d
Last synced: 7 months ago
JSON representation
Utility classes for caching and unloading assets such like textures
- Host: GitHub
- URL: https://github.com/coryleach/unityassetcache
- Owner: coryleach
- License: other
- Created: 2019-09-18T22:24:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T15:35:41.000Z (about 3 years ago)
- Last Synced: 2025-03-17T05:03:15.225Z (7 months ago)
- Topics: asset, assets-management, cache, downloader, package, unity, unity3d
- Language: C#
- Size: 33.2 KB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Gameframe.AssetCache 👋
Library for caching and unloading assets
## Quick Package Install
#### Using UnityPackageManager (for Unity 2019.3 or later)
Open the package manager window (menu: Window > Package Manager)
Select "Add package from git URL...", fill in the pop-up with the following link:
https://github.com/coryleach/UnityAssetCache.git#1.3.0#### Using UnityPackageManager (for Unity 2019.1 or later)
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
```js
{
"dependencies": {
"com.gameframe.assetcache": "https://github.com/coryleach/UnityAssetCache.git#1.3.0",
...
},
}
```## Usage
```c#
//Create an asset cache (like a WebTextureCache)
var cache = new WebTextureCache();//Get a cached asset asynchronously
var cachedAsset = await cache.GetAsync(url);//Use the asset
image.texture = cachedAsset.Asset;//Dispose the reference so the cache knows you no longer are using it
cachedAsset.Dispose();
cachedAsset = null;//Clean the cache so all assets with zero references are unloaded
cache.ClearUnusedAssets();
```## Author
👤 **Cory Leach**
* Twitter: [@coryleach](https://twitter.com/coryleach)
* Github: [@coryleach](https://github.com/coryleach)## Show your support
Give a ⭐️ if this project helped you!
Please consider supporting it either by contributing to the Github projects (submitting bug reports or features and/or creating pull requests) or by buying me coffee using any of the links below. Every little bit helps](https://ko-fi.com/coryleach)
***
_This README was generated with ❤️ by [Gameframe.Packages](https://github.com/coryleach/unitypackages)_