Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

How to use a remote URL of the form https://domain.com/storage/[BuildTarget]?param=something

Discussion in 'Addressables' started by CanisLupus, Mar 19, 2020.

  1. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    304
    We want to load our addressables from a URL like this:

    https://domain.com/storage/[BuildTarget]?param=something


    When we try loading an addressable from that URL, the asset's address is appended to the end, becoming something like:

    https://domain.com/storage/StandaloneWindows?param=something/assets/addressables/somefolder/file_random_hex.bundle


    This breaks, since the parameters "?param=something" should come last. Is there a way to go around this?

    Thanks!
    Daniel
     
    Last edited: Mar 26, 2020
  2. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    304
    Anyone?
     
  3. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    161
    I think you should be able to write your own provider, then set that in your group settings. Duplicate the default AssetBundleProvider then add the functionality you want. (I haven't tried this myself, but I've seen devs mention it in other threads.)
     
  4. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    304
    Thank you, @ProtoTerminator. I was just about to reply to you when I found this in the documentation: Customizing URL Evaluation.

    We seem to be able to set a custom method to transform the Addressable locations at runtime (Addressables.InternalIdTransformFunc). Their example is actually mostly what I was looking for. I won't be able to test this for a while but it should help. :)
     
unityunity