Manual Addressable Asset System with github

Tram Ho

Hello friends!

I will show you how to use something very interesting in Unity, this is quite new, hoping to bring the best solution or at least the easiest to use for you. ?

As the title I also mentioned, today I will guide you to use the Addressable Asset System.

So what is the Addressable Asset System?

You can learn to help me here , because I present here will be wordy and not the focus of the article!

Ok, let’s go!

Step 1: Install package Addressables.

  • You open Window -> Package Manager

  • Next, you search for the keyword “Addressables”
  • Then select it and press Install.

Step 2: Create Group Addressables.

  • You choose Window -> Asset Management -> Addressables -> Group

  • Click “Create Addressables Settings” button

  • We will have the Addressable Groups management interface as follows:

Step 3: Add Addressable To Object.

  • You choose into a prefab created before and then tick the Addressable box in the Inspector:

  • At the same time you name (can include arbitrary paths) for it as shown on his picture to temporarily ABC, you can set it as Prefabs / LogoSunNews

Step 4: Setting Addressable.

  • You click on the group you use, you can always use its default, or rename it, or create another new group to work, here I renamed it to RemoteGroup.
  • Next you set the Build Path to “RemoteBuildPath”, Load Path to “RemoteLoadPath”.

  • You click on System Settings in the upper corner, click on Manager Profiles then create a profile with the variable RemoteLoadPath as the host address where you save your assets later game load / update.

  • Go back to System Settings, change Profile In Use to “Development”, check the Build Remote Catalog (check required to be able to update later), at the bottom also select the Path of both parts is remote.

Step 5: Build Asset And Load.

  • In the Addressables Group window, click Build -> New Build -> Default Build Script.

  • Wait for it to finish building you into the folder under the path “Project ServerData StandaloneWindows” (StandaloneWindows is your target build, it could be android, ios …) copy all the files uploaded to the store is the location Only you added in the Profiles above.
  • You create an empty gameobject on the scene, then add a script named “AssetManager” (whatever name you like, I’ll put it here. ? ) then add the following script:

  • Go back to the Inspector and select the assets you just named.

  • Build the project and run it to see if there are any errors!
  • NOTE: I have encountered an error saying “Unknown error in AsyncOperation” actually encounter various errors and it still says this, then you try to return to the gameobject on the other scene, select the asset as none, then select Your assets are still considered as errors!
  • The delicious standard is that after the build and run it will load your prefabs up nicely ^ _ ^

Step 6: Update Asset.

  • If you want to update your assets later, like adding levels, updating UI … then do this step,
  • After you have updated everything, open the Addressable Group window again, select Build, select Update a Previous Build, select the following link “Project Assets AddressableAssetsData Windows” (Windows is the target you want to build. ) then select the bin file in it to overwrite.

  • Next, you copy the newly built files in the old directory, “Project ServerData StandaloneWindows” (StandaloneWindows is your target build, it can be android, ios …) and push to the host as before.
  • That’s it, enter the game and you will see it automatically updated without rebuilding the apk, downloading the apk or bla bla at all.
  • NOTE: If any of you try to update assets on github like me (play for free because of poverty), then you need to wait about 4-5p after uploading the game to download the new assets, so if you still see the asset on the game If you are old, don’t panic! Possibly due to github cache to not be accessed too much! Or whatever the reason I don’t know just know how to experience it =)))

I wish you success, I found it interesting to research this, apply quite a lot to my upcoming projects ^ _ ^

Share the news now

Source : Viblo