Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to make a downloaded file in runtime as addressable via code

Discussion in 'Addressables' started by Halen1999, Sep 10, 2019.

  1. Halen1999

    Halen1999

    Joined:
    Sep 10, 2019
    Posts:
    3
    Hi, I have an app that need to download a file from Firebase when it runs and I want to make that file addressable via code. I've made a prototype in PC and tried this tool https://github.com/favoyang/unity-addressable-importer but I receive this error

    upload_2019-9-10_10-44-48.png
    My Addressable Import Setting
    upload_2019-9-10_10-41-53.png

    And this is my code to load it
    upload_2019-9-10_10-43-59.png



    I dont know what should I do to fix it. I tried to read the document but it's so confusing :( Thanks for reading.
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    I'm afraid you probably need a tutorial for basic concept, like this one https://forum.unity.com/threads/demo-tutorial-for-remote-hosting-using-amazon-s3.724022/

    Thanks for trying the importer, but you won't need it at the moment. It's for automation asset importing, eg. when you have hundreds of them. Simply remove the package and focus on the basic is better.

    For firebase hosting, it could be a little bit tricky because of lacking the http protocol, this may help https://forum.unity.com/threads/how-to-load-addressables-from-firebase-storage.739964/
     
    Halen1999 likes this.
  3. Halen1999

    Halen1999

    Joined:
    Sep 10, 2019
    Posts:
    3
    Hi, thanks for the reply, I've watched this video and I'm still not get it. In my case, I want to make an asset as addressable asset, but that asset is not in the project when I build, it appears when I run the app only. The video you showed me seems like not matching my case. :(
     
  4. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    My misunderstanding then. So what you want is to use addressables API to load an asset (bundle) not generated by the system? That will be much harder. You need prepare a catalog, and write a custom asset provider (check out BundledAssetProvider). That make sense if you intend to load asset bundles not build by the system. However in your example, why not just read the text file directly?
     
    Halen1999 likes this.
  5. Halen1999

    Halen1999

    Joined:
    Sep 10, 2019
    Posts:
    3
    The text file is just my testing :D In my actual game I want to use the Addressable Assets to make the DLCs system. So is there any way to do this with Addressable Assets? I'm using AssetsBundle but I found the new one easier so I want to make a switch.
     
  6. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    That probably a broad topic. Unless you have specific requirements, DLC is a trivial case for the system. eg. simply make each of your DLC a group (which turns into a bundle).
     
  7. stevenchristian20

    stevenchristian20

    Joined:
    Dec 23, 2019
    Posts:
    25
    I am trying to make a DLC system, and I am having trouble. I have assetbundles on Firebase Storage that I am trying to get onto my device on startup. Do you have an example script or references to download and load assets into a scene on startup?
     
  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,340
    I have a use case that during runtime, the player is able to make mods in the game.

    Given: An addressable bundle with game assets has been previously created using Unity's Editor and uploaded to a server.

    Scenario: During runtime, a player can paint a picture or modify a mesh.

    Question: Is it possible for the new assets created in-game during run time to be added to the previously created bundle?

    Cheers
     
  9. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    56
    AssetBundle cannot be created or modified at runtime
     
unityunity