Search Unity

Multiple platforms inside of StreamingAssets

Discussion in 'Addressables' started by rmuk, Nov 19, 2018.

  1. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    65
    My application has both Android and iOS build targets. There are about 90MB of addressable assets and after making the build for iOS, i had the iOS folder in StreamingAssets/com.unity.addressables. Once i switched platforms and built for Android i now have both an Android and iOS folder in StreamingAssets/com.unity.addressables, effectively doubling the size of my OBB file. Is it safe to remove/delete the unused platform when building? If i do remove it, is there a way to trigger the system to rebuild a new one or do i have to copy/paste it back in every time?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    You can remove the wrong platform files. We are working on a fix to actually clean up after ourselves better when doing new builds.

    You could copy/paste back in, but in general you should be able to just rebuild. The incremental build works well in this system, so it should a very quick "nothing's changed" run and rebuild the old bundles quickly.

    -Bill
     
    optimise likes this.
  3. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    65
    Thanks! Does that build happen as a part of the normal application build process or do i need to manually trigger it somehow?
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    the build through addressables will automatically use the incremental build. For now that means it's all part of the main build, though in the future we are planning to make "building addressables" and "building the player" two separate steps (much better for large projects).

    -bill
     
    optimise likes this.
  5. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    65
    Great thank you! So far this system has worked wonders for getting our memory footprint under control.
     
  6. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I would like to see something like when building StreamingAssets using Addressables, it's outside of the project folder just like how Remote works. When building real player build, it will copy the StreamingAssets folder back to project folder. After finish building, it will remove StreamingAssets folder from project folder. Maybe since you own the whole build pipeline, you can achieve the same result without needing copy the StreamingAssets folder back to project folder.


    I assume in Packed Mode, the built asset bundles are same asset bundles when in real player build. So, if you run Packed Mode before, it should skip building all the asset bundles that has no changes when doing real player build. It also need to auto remove catalog_BuildScriptPackedMode generated by Packed Mode when doing real player build. Or maybe just share the same catalog name regardless of whether it's Packed Mode or real player build.
     
  7. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Building to not-streaming-assets: this is definitely something that could easily be done with a custom build script. Those are pain right now, but we will keep this use-case in mind as we revamp the builds. Ideally this would be a super simple feature to enable/disable.

    As of the next release, building the bundles will be a manual process. So if you are going into play mode, or building the player, you'll need to build the bundles first.
     
    optimise likes this.