Search Unity

Downloading A Scene and/or Assets for use in-game

Discussion in 'Scripting' started by KaanSerin113, Mar 3, 2020.

  1. KaanSerin113

    KaanSerin113

    Joined:
    Nov 17, 2012
    Posts:
    6
    Hi everyone.
    I am struggling to figure out a way of implementing an in-game asset/scene download feature like those in mobile casino games.



    There are tiny download icons on each slot game.
    Each game takes roughly 30MB of space

    How would I go about implementing something similar to this with Unity?
     
    unity_7zw9ebm9jBJwig likes this.
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You break up all the assets for each mini game into its own Asset Bundle. You download the Asset Bundle as needed. All of the code has to be integrated into the main game binary, as code can't be included in Asset Bundles, but code doesn't take up much space.
     
    KaanSerin113 and Kurt-Dekker like this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    What Uncle Joe said above is spot-on... and when you design your AssetBundles, always use complete Scenes rather than collections of tons of random assets. If you use the latter, you will have to write specific code to load and connect every piece, whereas if you use the Scenes-type of asset bundle, you just load the scene and you're done.
     
    KaanSerin113 and Joe-Censored like this.
  4. duartedd

    duartedd

    Joined:
    Aug 1, 2017
    Posts:
    150
    addressables would also work with this download and load the appropriate assetpack when appropriately called
     
    KaanSerin113 likes this.
  5. KaanSerin113

    KaanSerin113

    Joined:
    Nov 17, 2012
    Posts:
    6
    Thanks for the replies. I am currently getting familiar working with Asset Bundles. I just have one more question.
    I am planning on publishing my game on the Google Play Store. Would I have to add those files with the apk file on the release page? I assume they won't let me pull data from a random server.
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,735
    Not possible. You can only have the signed APK or AAB and any OBB expansion parts, not just stray files.

    Actually this is exactly how you do it. But you're welcome to stick it in the Streaming Assets folder in Unity3D too, which gets it pulled into the build. But if that's all you're doing, it begs the question of why even do it: just access the resources "normally" in Unity.
     
    KaanSerin113 likes this.
  7. filipemourao_

    filipemourao_

    Joined:
    Oct 9, 2020
    Posts:
    57
    How exactly would this be done. I've been struggling to find an answer to this question on how to use addressables for this sort of download