Search Unity

Download User Generated Contents Using Addressable

Discussion in 'Addressables' started by Lazyb0y, Jun 21, 2021.

  1. Lazyb0y

    Lazyb0y

    Joined:
    Nov 7, 2014
    Posts:
    1
    I am trying to build a platform using Unity 2019.4.21f1. This has 2 types of users.
    1. Who are going to create custom environments with NPC and other objects, then will create an AssetBundle and then will upload the file via a web app.
    2. Who will be able to select a world (previously uploaded by user type 1) from a list fetched from the service. The app will download that AssetBundle from the link where the AssetBundle file is uploaded previously.
    We can do this like;
    Code (CSharp):
    1. IEnumerator GetAssetBundle() {
    2.         UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/myData.unity3d");
    3.         yield return www.SendWebRequest();
    4.         if (www.result != UnityWebRequest.Result.Success) {
    5.             Debug.Log(www.error);
    6.         }
    7.         else {
    8.             AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(www);
    9.         }
    10.     }
    But while doing this in a URP project I faced an issue, where the asset bundle was not packing the shader I was using from the URP package. Similar issue is reported here https://forum.unity.com/threads/package-assets-not-included-in-asset-bundles.633217/

    Also in the newser Unity editors (2021.**) I didn't find the Manager package to package Asset Bundle. This post (https://docs.unity3d.com/Manual/AssetBundlesIntro.html) is saying Unity has deprecated the AssetBundle Manager.

    I switched to AddressableAssetBundle and as my current knowledge, I have to maintain a catalog and use weak references. I won't be able to use a user-generated link to download a assetbundle runtime.

    Am I missing something here? Is it possible to generate the AssetBundle file using the recent (2021.+) unity versions and download those files without setting up the RemoteServer needed for AddressableAssetBundle?

    In short, All I want is to download AssetBundle file which link will be created and uploaded after I publish my app using the newer Unity editor and has to support URP. How can I do this?
     
    JerryZ19 likes this.