Skip to content

Addressables

These are Unity Addressables, that you can assign to your object parameters. If you are not using Addressables in your game, you should ignore this page.

Install Addressables Plugin

First of all, you need to install the latest Unity Addressables package.

Screenshot

Next, install the Balancy package:

  1. In Unity Open Tools ► Balancy ► Updates
  2. Install the Addressables + CDN Hosting plugin.

Screenshot

In the asmdef file of your game, you need to add the reference to the Balancy.AddressablesNew assembly. This is necessary for the Addressables to work correctly with Balancy.

Screenshot

Synchronize Addressables

Screenshot

  1. In Unity Open Tools ► Balancy ► Config
  2. Click on Addressables (NEW).
  3. Follow the instuctions in the window:
    1. Create Balancy profile by clicking on the button in the first section.
    2. Provide the Private Key of your game, you can find it in the Balancy dashboard.
    3. Activate all the Addressables Group you want Balancy to host for you.
  4. The window should look like this: Screenshot
  5. Start Build
    1. Balancy generates Addressable bundles and stores a local copy in the Library/BalancyData folder.
    2. Balancy uploads the Addressable bundles to the CDN.
    3. Balancy generates a JSON file with the list of all Addressables and their URLs, uploading it to Balancy servers.
  6. What's next
    1. Go back to Balancy and refresh the page. Open the Assets/Addressables section. You can see the previews for your assets: Screenshot
    2. In order to make the bundle public, you have to Deploy the changes.

If you have any parameter of type Asset, you'll be able to pick it from the dropdown menu: Screenshot

How to test

You can load the addressable in your game using the following code:

If you have a document with an Asset parameter, you can load it like this:

document.MyAsset.LoadAsset(asset =>
{

});
//if the asset is a type of sprite:
document.MyAsset.LoadSprite(sprite =>
{

});

Alternatively, you can load any asset by its name:

Balancy.AssetsRuntime.GetObject("MyAssetName", asset =>
{

});
//if the asset is a type of sprite:
Balancy.AssetsRuntime.GetSprite("MySpriteName", sprite =>
{

});

While testing in Unity, the local Addressables are used by default. If you want to test the production version, using the CDN: 1. Open Window ► Asset Management ► Addressables ► Groups 2. Select Play Mode Script ► Use Existing Build 3. Make sure you've built the Addressables using Balancy tools before testing.

Screenshot