Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Why should delete StreamingAssets files after "Build for Content update"

Discussion in 'Addressables' started by NoobCoderFake, Feb 12, 2019.

  1. NoobCoderFake


    Nov 24, 2015
    Here's what I do:
    1.Build player content.
    2.Upload remote resources to RemoteResourceServer
    3."Play Mode Script" switch to "Packed Play Mode"
    4.Press Play button in Editor, to confirm that all remote resources are ok.
    5.Change prefab in Editor, and then "Build for Content update"
    6.After build finished, AAS automatically delete all files in folder "StreamingAssets/com.unity.addressables"
    7.So I cannot play in editor anymore, with an error "Player content must be built before entering play mode with packed data. This can be done from the Addressable Assets window in the Build->Build Player Content menu command." occured, which is reasonable, as all data stored in StreamingAssets was deleted.

    My question is, why should delete StreamingAssets there?

    And in ContentUpdateScript.cs line 250:
    settings.GetAllAssets(allEntries, g => g.HasSchema<BundledAssetGroupSchema>() && g.GetSchema<ContentUpdateGroupSchema>().StaticContent);
    so if there's a group with <BundledAssetGroupSchema> but no <ContentUpdateGroupSchema> attached, when "Prepare For Content Update" there will be an null reference exception throw out. Maybe a little more check like
    Code (CSharp):
    1. settings.GetAllAssets(allEntries, g => g.HasSchema<BundledAssetGroupSchema>() && g.HasSchema<ContentUpdateGroupSchema>() && g.GetSchema<ContentUpdateGroupSchema>().StaticContent);
    or more specific error message like
    "missing ContentUpdateGroupSchema on group xxxxx" is better for users to understand what's incorrect.