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

Addressble 0.2.1-preview does not work in Unity 2018.2.1f1

Discussion in 'Addressables' started by Kichang-Kim, Aug 1, 2018.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    Hi, I tested Addressable System 0.2.1-preview with Unity 2018.2.1f1.

    Default setting (BuildPath:LocalBuildPath and LoadPath:LoadlLoadPath) works fine, but when I change BuildPath and LoadPath to remote setting, it is reverted to Local setting when I click "Play" in editor and al assets loading are failed. (return null without any error message)

    Also Resource Profiler shows nothing even Addressable assets are successfully loaded in editor.
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Hi, thanks for testing out Addressables. I believe I can help with both issues.

    1. For the settings being reverted when you enter play mode... There are some settings that are not properly marking the AddressableAssetSettings object as dirty. So if you set those variables, and only those variables, then enter play mode, the new data is lost during the assembly reload. This should be fixed in the next release
    2. In the options of AddressableAssets there is an option for "Send Profiler Events". Sending events to the profiler is expensive, so we give you the ability to turn it off, and by default it is off. Is this the case here? That you haven't enabled that flag? We are planning to add a warning to the profiler window if it is open and this setting is off, we just have larger functionality pieces to deal with first.

    Hope this helps, please let me know if there are any issues remaining.

    Thanks,
    Bill
     
    Kichang-Kim likes this.
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    @unity_bill Thanks for reply.

    1. >> I'll wait for next release :) How about ETA?

    2. >> Enable "Send Profiler Events" make Resource Profiler to correctly works.
    Should this flag be disabled when I build a release package? If it is, can flag be modified via script? or it is only affect editor mode?
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    1. ETA? hmm, soon? Probably in a few weeks. Of note though, the workaround is to change any other part of the addressable settings. For example, marking an asset as addressable, moving which group it's in, or adding/removing a label on any asset.
    2. You should disable the flag when shipping a real product. If you do a build with this on, deploy it to a device, you can actually use the profiler to monitor the behavior of that running app. You cannot yet enable/disable this form runtime code, but the feature would make a lot of sense and we will look into it.

    -Bill
     
  5. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    @unity_bill
    Hmm, Does addressable system provide editor (build-time) API for automated build processing? Can I change build option via that APIs? (like Resource Profile, Send Profiler Events flag and so on)
     
  6. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    I found that BuildScript.PreparRuntimeData() and achieved basic automated build via this code:

    Code (CSharp):
    1. static void BuildPlayer(string profileName, string outputPath)
    2. {
    3.     AddressableAssetSettings setting = AddressableAssetSettings.GetDefault(false, false);
    4.  
    5.     string profileId = setting.profileSettings.GetProfileId(profileName);
    6.  
    7.     string previousActiveProfileId = setting.activeProfileId;
    8.  
    9.     setting.activeProfileId = profileId;
    10.  
    11.     BuildScript.PrepareRuntimeData(true, false, false, true, false, BuildTargetGroup.Android, BuildTarget.Android);
    12.     BuildPipeline.BuildPlayer(EditorBuildSettingsScene.GetActiveSceneList(EditorBuildSettings.scenes), outputPath, BuildTarget.Android, BuildOptions.None);
    13.    
    14.     setting.activeProfileId = previousActiveProfileId;
    15. }
    But it seems that StreamingAssets is need to be removed manually.