👨‍💻Using AGC Cloud Storage with Unity Asset Bundle

Bünyamin Eymen Alagöz
Huawei Developers
Published in
3 min readFeb 20, 2023

--

Introduction

Hi everyone. In this article, we will talk about the definition of Cloud Storage, one of the services provided by App Gallery Connect, the reasons we may need this AGC service in game projects, integration to the Unity game engine, and how to use this service in game flow.

Asset Bundle & Cloud

What is Asset Bundle?

Unity Asset Bundle is a file format developed for the Unity game engine. This file format allows the storage of visual and functional elements (assets) in the game in bulk. For example, a game’s graphics and sound files, character models and animations, materials, or their compilation into a prefab may be stored in Unity Asset Bundle files.

What is AGC Cloud Storage?

AGC Cloud Storage is a cloud-based data storage service provided by App Gallery Connect. AGC Cloud Storage allows users to store their data securely and flexibly. This service includes critical functions such as backing up, protecting, and accessing your data and supports all file types.

🚧Integration of AGC Cloud Storage🚧

First of all, you should create the project in AGC and then adjust the settings. You can find the necessary details here.

🚧AGC Cloud Storage Integration🚧

You can refer to this for Unity integration.

🚧Phases🚧

1- Create Asset Bundle architecture on the Unity side.

Firstly create the following editor script.

BundleBuilder.cs

Adjust the prefab asset bundle definition then run the BuildAllAssetBundles method by clicking Assets — Build AssetBundles in the menu (Don't forget to set your own directory in line 8). Then You will get asset bundle files. Then import these files to AGC — Cloud Storage panel.

Asset Bundle File

2- Upload files to the Cloud Storage panel.

Cloud Storage AGC Panel

3- Download asset bundle files in runtime with AssetBundle.LoadFromFile() command. Then de-serialize as gameObject in Unity scene. Finally, you can continue the game flow.

Conclusion

It is possible to bring huge gains to your mobile game project by using Cloud Storage. In this article, we have established a structure that gets game assets in runtime. It is also possible to make all our updates before a new version is released on the store, provided that a good architect is installed in the Unity game project. In this way, you can take your game to the highest point in a short time by applying very fast touches. Yes, you heard right :) Market tests usually take between 3 and 6 months during the first release phase. Thanks to the structure that we can establish with Cloud Storage, it can be easy to fit the 6-month process into 1 month!

References

--

--