Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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

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

  1. NoobCoderFake

    NoobCoderFake

    Joined:
    Nov 24, 2015
    Posts:
    34
    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.