I have generated asset bundle from unity and i am trying to upload it to google server, most probably i am expecting firebase provides such services. I am trying from last two days but i didn't found a solution to upload the asset bundle to firebase server. And also i am not sure that google provides the server services for the android / IOS games where we can upload the asset bundle files. I also need to understand about the mechanism to upload it.
I have tried the amazon server in past, that works perfectly but i am wondering is google also provides such services if it is more likely to be used.
Simple code (standard) was used to download the asset bundle from server.
i want to know the mechanism to upload the asset bundle files from unity on firebase server or google server, and of course i would like to hear the comparison with amazon server. i would also like to get the percentage of downloaded asset bundle size at download time so that the user can know how much data he has downloaded and how much left.
There's not a complete end-to-end integration in Firebase that I know of for uploading AssetBundles from the editor and pulling them down in the client. There is the Firebase Cloud Storage SDK that you can use. I'll give you a brief overview of how you may use it.
I like to use the AssetBundle Browser to build my bundles:
And, using the Firebase Console on the web, I can upload these files to a Cloud Storage bucket. For most simple games, I simply mirror this directory layout:
Once you have your data uploaded, you can get the URL with the Cloud Storage SDK I mentioned before:
// Create a reference from a Google Cloud Storage URI
Firebase.Storage.StorageReference reference =
storage.GetReferenceFromUrl("gs://bucket/AssetBundles/Android/samplescene.manifest");
// Fetch the download URL
reference.GetDownloadUrlAsync().ContinueWith((Task<Uri> task) => {
if (!task.IsFaulted && !task.IsCanceled) {
Debug.Log("Download URL: " + task.Result());
// ... now download the file via WWW or UnityWebRequest.
}
});
Once you have all the URLs, you can use your favorite method to load them into Unity.
There are of course methods for Cloud Storage to download directly to file if you don't want to use Unity's caching as well as placing them directly into memory.
Now, I mentioned that there isn't any end to end solution to upload your asset bundles to Firebase. There is an Uploading API as well as an Admin SDK if you wanted to build your own pipeline to automate that.
I hope this all helps!