Addressable Requests
Helper API for interfacing with Unity's Addressables system.
com.jonagill.addressablerequests 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/addressablerequests.git?path=Packages/com.jonagill.addressablerequests README Markdown
Copy this to your project's README.md
## Installation
Add **Addressable Requests** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/addressablerequests.git?path=Packages%2Fcom.jonagill.addressablerequests
```
[](https://www.pkglnk.dev/pkg/addressablerequests)README
Addressable Requests
This library provides a helper API for interfacing with Unity Addressable asset requests. It provides the following benefits on top of interacting with Addressables directly:
- All load requests are backed by my Promises library, providing a convenient method for getting notified when your assets are loaded and chaining additional behavior.
- All load requests will log errors if they fall out of scope without being disposed, helping make sure you release all of your requests to avoid memory leaks
- Supports intantiating prefabs with
Object.InstantiateAsync()on Unity 2023.3 and newer, heavily reducing the amount of time instantiation spends on the main thread.
Installation
Addresable Requests relies on my Promises library for providing callbacks when routines complete. We recommend you install both libraries via OpenUPM. Per OpenUPM's documentation:
- Open
Edit/Project Settings/Package Manager - Add a new Scoped Registry (or edit the existing OpenUPM entry) to read:
- Name:
package.openupm.com - URL:
https://package.openupm.com - Scope(s):
com.jonagill.addressablerequestsandcom.jonagill.promises
- Name:
- Click Save (or Apply)
- Open Window/Package Manager
- Click the + button
- Select
Add package by name...orAdd package from git URL... - Enter
com.jonagill.promisesand click Add - Repeat steps 6 and 7 with
com.jonagill.addressablerequests
Usage
All methods for access are exposed via static methods on the AddressableRequest class. You can then use request.LoadPromise with the entire Promises API to get notified when your request completes.
All requests are IDisposables, so just call request.Dispose() when you're done to clean up all of your loaded and instantiated assets.
No comments yet. Be the first!