How-to use Unity3D Addressable Assets with Google Cloud Services

Badger Dox
3 min readDec 2, 2019

--

Part 3 of 3: Building and Loading Addressable Assets with Google Cloud services

Previous tutorial: Part 2 of 3 — Connecting Unity3D’s Addressables to a Google Cloud Bucket

Project & Code

Need help? Just wanna hang? Join the discussion on Discord

When you finish this tutorial, you're build will no longer be bloated with unnecessary locally hosted assets. The last tutorial, part two finished by opening up a new folder called ServerData. If it’s not open, go ahead and do. Inside Unity3D → Project Window → highlight Assets → Right-click → Show in Explorer → ServerData. An additional folder will be found in ServerData. It will contain the build data and named for its platform.

For example, I’m developing this tutorial only for Android that means I have 1 folder within ServerData named Android which contains 3 files.

It is time to upload the necessary folder to your cloud. Inside Google Cloud Console open up your bucket. Click the 3 Settings bar icon on the top left corner and scroll down to storage clicking on it. When the page is loaded click on the name of your bucket. Now, drag and drop the folder(s) inside of ServerData here into the bucket.

In order to use the assets remotely, we will have to call for them in code. Go back into Unity3d. Right-click to create a new class and name it LoadAssetsFromRemote, once created add it to a game object within the hierarchy. Here is a simple snippet that loads and creates the hosted addressable assets. For more information on how Addressables loading works please check out these other great tutorials. For now, go ahead and type the code below into your class.

Don’t forget to set your label within the inspector!

With Unity set up to build remotely and our Google Cloud bucket filled with the files Unity requests, it’s time for the grand finale build and testing!

While the project builds some new operations are happening. First, it is copying addressable data into the project’s build. Then It stripes out the corresponding assets freeing up that sweet, sweet memory.

You did it, Amazing & Great Job!

With a successful build status, you will see your resources populate immediately after the Unity3D Splash screen! With hosting addressables now simple go focus on making some games for the rest of the world to play!

Find this series helpful? Please share it anywhere other people will find it useful. Anything unclear? Want to share your accomplishment? Leave a comment or join us on Discord!

--

--