Search Unity

Android/IOS - Download new levels after purchase

Discussion in 'Unity IAP' started by Robert_Hildebrand, Jul 2, 2020.

  1. Robert_Hildebrand

    Robert_Hildebrand

    Joined:
    Sep 19, 2018
    Posts:
    15
    I have a 2d puzzle game that has 7 free levels after which the user can pay for 7 more through the app store. I need to know that right way to download these new levels. I've read about using asset bundles but others have had problems extracting assets and placing them in the proper resource directories. Need advice here and code snippets. If you've got a mechanism that works reliably I would like to hear about it. I would like to create a mechanism that can handle audio, art, level data, etc. I'm seeing problems with others not being able to drop objects from in the resource folder. Surprised nobody has build an asset package that can do this in the Unity Store. Any help and best practices would be appreciated?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would not download the new levels, they would already be in your game, and you would simply unlock them as needed.
     
  3. Robert_Hildebrand

    Robert_Hildebrand

    Joined:
    Sep 19, 2018
    Posts:
    15
    Thanks for the reply Jeff. That's a pretty obvious way of dealing with this, however I'm thinking about keeping the size of the installation smaller and providing a method for downloading these assets in the form of an asset bundle or some other sort of package that can be deserialized to the device. Each set of levels would have new graphics, music, etc... and would only be available through a confirmed purchase whereby I would access this package through a call similar to this UnityWebRequest.Get("http://www.my-server.com/ios/levels8_14/package"))... at the end of each set of levels the user would purchase the next set of levels, and so on. So the goals is... keep the installation size small, be able to provide a simple method for downloading new assets from the web and pulling those assets into the game. I've read that this very difficult to unpack an asset bundle and drop these new assets to the device. Is there a better way to handle this?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Since this is not IAP specific, you might have better luck asking here, you could test with a button click instead of an IAP purchase to speed up your development https://forum.unity.com/categories/build-pipeline-runtime-asset-management.154/