You've seen the potential benefits of Addressables and you want to give it a shot in your game. But there're so many possibilities! Where to start with your Unity Addressables Migration? Here's an option for you: Music.

Those famous last words of a videogame musician convincing a programmer to add the last audio track to the game that was about to be released. What could possibly go wrong? I'll tell you: that last song added a mere water drop to a glass that was about to spill. And effectively, it spilled. These extra 10MB added by the song were needed when Bobby received an SMS from his girlfriend asking him to do the laundry. And so the Operating System decided to take its memory back. The evil OS killed the game Bobby was playing for the last two hours. And you know what was the funny part? The savegame became corrupted . Do you know what our friend Bobby did? I'll tell you what he didn't do. He did not buy a more powerful device. Instead, he furiously flipped the table that was in front of him . Only that the table was made out of glass. There's something Bobby did before cleaning all the shards from the floor. He promised to himself to do all he could to prevent this from happening to other users. Bobby went to the app store and wrote the most famous 1-star review in history. People emotionally connected so well with him that his review got incredibly upvoted. So upvoted, that it surpassed and eclipsed all 5-star reviews. And indeed, no more crashes ever happened to any other user, because new players held their fingers off the install button. What could Bobby have done instead? Well, Bobby could have messaged the developer instead to send him the article you're about to read.

Lowering your memory consumption to reduce crashes? Increasing performance? Reducing loading times?

No matter what your goal is. If you want to start using Addressables right away, you'll experience the Unity Addressables Migration process.

Migration is nothing else than moving from where you are to the place you want to be.

In the context of this series, we'll be migrating the asset management system you're currently using over to an Addressables-based one.

Yes, even if you're not aware of what an asset management system is, you're already using one by default: Unity's direct references.

As I'll show you later, you can say you have a direct reference to an asset every time you assign this asset from the Project view to a field of a component in the inspector. For example, assigning a sound to the field AudioClip of an AudioSource is considered as having a direct reference to that sound.

But what's the crack with these direct references?

This should be your main concern: Unity will automatically have directly referenced assets loaded in memory. And there's nothing you can do about it other than not having that direct reference present.

What a burden.

The alternative is using indirect references.

And the benefit?

With Addressables you choose when and whether to load the asset you're pointing to. Particles, prefabs, textures, music, you name it. By doing this you'll reduce memory consumption, increase performance and gain other several huge advantages such as the possibility of shipping DLCs etc..

In this blog post you and I will start the level-up journey and migrate one of the most common types of content in a beautifully crafted game: soundtracks.