Skip to content

Uniasset

High-performance external asset loading for Unity

Built on native Rust libraries, Uniasset brings asynchronous and efficient image and audio loading to Unity projects.

MIT C# + Rust


Why Unity asset loading is painful

External asset loading in Unity often runs into the same bottlenecks. Uniasset is designed to remove them.

Slow processing

Cropping or resizing textures usually means multiple SetPixels passes, extra copies, and format conversions.

Limited format support

Unity does not handle formats like WebP or FLAC well without extra tooling.

Inflexible data sources

Loading from network streams, encrypted packages, or custom storage layers is awkward.


Core features

Performance first

The core is written in Rust and exposed through P/Invoke FFI, making full use of native performance and SIMD-friendly paths.

Async by default

Expensive operations expose async/await APIs that fit naturally into Unity coroutines and Tasks without blocking the main thread.

Multi-format images

Supports JPEG, WebP, PNG, BMP, TGA, PSD, with built-in cropping and resizing.

Multi-format audio

Covers MP3, FLAC, WAV, PCM, Vorbis, OGG, and AAC decoding.

Custom data sources

Implement IUniassetStream to load from any source: network streams, encrypted bundles, AssetBundles, or memory caches.

One-step integration

Download uniasset-unity-scripts.zip from Releases, then use the editor menu to fetch and configure native libraries.


Architecture

1

C# SDK

A fully asynchronous C# API layer with high-level abstractions such as ImageAsset and AudioAsset.

2

P/Invoke FFI

A lightweight interop layer that talks directly to native code with no extra serialization overhead.

3

Rust Native Library

A high-performance Rust core responsible for decoding, processing, and memory management across platforms.


Supported formats

Images

  • JPEG
  • WebP (first frame only)
  • PNG
  • BMP
  • TGA
  • PSD
  • GIF (first frame only)

Audio

  • MP3
  • FLAC
  • WAV
  • Vorbis (OGG)
  • AAC

Code samples

Load and process an image

using Uniasset;
using Uniasset.Image;

using var image = new ImageAsset();
await image.LoadAsync("photo.png");

// Crop and resize
await image.CropAsync(0, 0, 256, 256);
await image.ResizeAsync(128, 128);

// Convert to Texture2D
Texture2D texture = await image.ToTexture2DAsync();

Load and play audio

using Uniasset;
using Uniasset.Audio;

using var audio = new AudioAsset();
audio.Load("music.mp3");

// Inspect audio metadata
Debug.Log($"Sample rate: {audio.SampleRate} Hz");
Debug.Log($"Channels: {audio.ChannelCount}");

// Convert to AudioClip
AudioClip clip = audio.ToAudioClip();

Integrate in three steps

1

Install the package

Download uniasset-unity-scripts.zip from Releases and extract it into your project.

2

Install native libraries

In the Unity Editor, run:

Tools > Uniasset > Download Native Libraries
Tools > Uniasset > Configure Native Libraries

3

Start loading assets

Import the namespace and begin loading:

using Uniasset;
using Uniasset.Image;

using var image = new ImageAsset();
await image.LoadAsync("assets/photo.png");

Ready to upgrade your Unity project?

Add high-performance, asynchronous, multi-format external asset loading to your game.

Start with the docs