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

Feedback Better AssetBundleProvider extensibility needed [1.18.13]

Discussion in 'Addressables' started by phobos2077, Jul 21, 2021.

  1. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    I'm writing custom AssetBundleProvider that should work as a drop-in replacement for regular AssetBundleProvider, but in the latest Addressables 1.18.13 I've found some members to be internal and thus making job of writing custom providers more difficulty than it should be.

    Namely:
    - AsyncOperationHandle.IsWaitingForCompletion - Need it to support WaitForCompletion().
    - AssetBundleRequestOptions.AssetLoadMode (and associated enum) - need it to support optional pre-loading.
    - ResourceManager.WebRequestOverride
    - WebRequestQueue and WebRequestQueueOperation - Not a problem to copy, but an extra step to make to write custom provider...
    - UnityWebRequestUtilities
    - ResourceManagerConfig.ExtractKeyAndSubKey - Used in BundledAssetProvider.
     
    Last edited: Jul 22, 2021
  2. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    Just realized that in latest Addressables now you have to also re-place BundledAssetProvider if you want to replace AssetBundleProvider... it's because previously it had dependency on IAssetBundleResource interface. Now for some reason it is dependent on specific default implementation of said interface.. I think it's obvious this is not a good practice for extensibility. Please consider making this code less interdependent @andymilsom
     
  3. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    You provide us with way of extending the addressable system but make everything in these base class internal.
    How can we do anything without duplicating everything? Can't you just make everything public?

    Last week I was making an analyser to check if some local asset was depending on remote asset. I found that the BuildLayout file had everything i needed but the class is internal. Why is it internal? Why is anything internal?
     
    phobos2077 likes this.
  4. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Flagging for the team!
     
    phobos2077 likes this.
  5. andymilsom

    andymilsom

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    294
    Thank you for the feedback. We will have a look to see what can be adjusted to improve the ability to inherit easier from the AssetBundleProvider/BundledAssetProvider
     
    idz_RyuNakamura and phobos2077 like this.