Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Changing remote data sources

Discussion in 'Addressables' started by TomKhan3, Nov 20, 2019.

  1. TomKhan3

    TomKhan3

    Joined:
    Jul 21, 2017
    Posts:
    18
    I've done my best in the last 3 days to find this myself with no luck.

    My goal is to have one app which can change catalogs and or load paths to load assets from different sources.

    So by default the built assets load from amazonaws.com/staging and my client would like the ability to switch the data sources to amazonaws.com/production so that remote assets can be tested before pushing to production.

    As far as I can tell this is possible but the methods are unclear. Do I use LoadContentCatalogAsync or do I change the RemoteLoadPath? I feel like the answers on the forum so far to this question are going over my head because this is the first time using data stored remotely.
     
  2. TomKhan3

    TomKhan3

    Joined:
    Jul 21, 2017
    Posts:
    18
    @DavidUnity3d Or anyone else. Just a yes or no would do on this, no instructions needed. Yes means I can continue to learn Addressesables, No means I can move on with my project using AssetBundles. Please, I'm begging.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    761
    Hey @TomKhan3 I think for your use case I'd recommend having multiple Addressables profiles for what you're trying to do. Have one setup with your staging paths, the other with your production paths. If you're making builds to test on device you would have to have two separate builds.

    Another option would be to create a standalone bootstrapping build that contains relatively little to nothing. When you start up your bootstrap app you could LoadContentCatalogAsync to pick which catalog you wanted loaded, then continue on to your title screen. Do note: once a content catalog is loaded it currently cannot be unloaded. You'd need to restart your app to pick the other option.

    Loading both your staging and production catalog at the same time will likely give you duplicated keys (assuming your staging and production assets have the same keys, of course). I suspect doing this will either 1) not the have intended behavior or 2) potentially load assets that you think are part of one catalog but are part of the other one.

    I was trying to think if there was anything else that you might could try but those are the two options I think are the most viable. Hope that helps
     
  4. TomKhan3

    TomKhan3

    Joined:
    Jul 21, 2017
    Posts:
    18
    @DavidUnity3d I appreciate your response very much, thank you.

    What you're saying about the content catalogs not being able to be unloaded without restarting the app is what I was afraid of, though, because it's for internal use, I could save the selected data source in player prefs and Application.Quit() then relaunch with the selected data source.

    Thanks!!
     
    davidla_unity likes this.