Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Anyone got Platform Specific Streaming Assets Clever Ideas?

Discussion in 'Editor & General Support' started by Enkiduouo, Jul 22, 2015.

  1. Enkiduouo

    Enkiduouo

    Joined:
    Mar 7, 2015
    Posts:
    13
    Have platform specific assets in streaming assets - I know Unity doesn't currently support platform specific streaming assets directly - anyone have any clever ideas on how to implement this?

    So I have

    StreamingAssets/
    ---- Android/
    ---- iOS

    When I build for the android platform I want to not include iOS, and vice versa.
    My thoughts were an editor script which ties into the build system and moves the opposing folder out of assets or something - I haven't done a ton of integration with the unity build pipeline though.
     
    liortal likes this.
  2. novabyte

    novabyte

    Joined:
    Feb 27, 2015
    Posts:
    12
    I think what you're looking for is something called "App Thinning". It's an extremely recent addition to the iOS platform by Apple and is only support on iOS 9.0 and greater. As far as I'm aware Unity does not have support for the XCode configuration required to perform App Thinning although you could probably set it up manually yourself. You can read more about the Apple support for it here:

    https://developer.apple.com/library...istributionGuide/AppThinning/AppThinning.html

    I have no idea if Google have any support for this kind of build/package optimisations.

    The alternative solution is to use an object storage service like Amazon S3 and provide a "patching system" which can upgrade Assets in the game client at runtime and store them locally on the device. I'm working on a game backend which will have support for this feature very soon (we call it Asset Delivery). The service is called GameUp; if you're interested I can send you an internal document I have for the design of the feature and you can let me know what you think.

    :)
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    We are currently implementing a solution that can achieve what you want.

    Basically, we created a concept called "workspaces". Each workspace is a specific configuration of our game (iOS, Android, Amazon, etc).

    When switching between workspaces, we copy/remove folders from the project, so for each build we only get EXACTLY what we want, and nothing else.

    We have a custom editor script that switches between these workspaces.
    The actual implementation we used creates symlinks (a folder that is actually a pointer to another folder).

    I could elaborate a bit more about our solution, but for your case, you can simply have an editor script that will move stuff in/out of StreamingAssets.