- Home /
Best approach for Asset Bundles.
I'm just looking for some feedback on what is the correct or best approace for using asset bundles to carry out a feature I need for an application.
I have a game where there is 5 or more levels on a tower and each level contains about 5 or so items (It can contain more or less) each Item can be clicked on and has information about it.
I need to have some way of downloading these assets on runtime to the application. The best approach I saw was the asset bundles. The items on each floor may change from time to time. For example there may be a crown asset and it could be modified or updated so I would need to swap it out for the newer version when the app is booted up.
I have an sqlite database which contains the item info, name, level it is located and the url to the asset bundle where it is stored. I think in the future I would also need an asset version field to keep track in the database of what version the asset is on then have a list stored locally on the device and cross referance it with the database versions to see if I need to redlownload the asset or not.
For now this is just a proof of concept so I will just redownload everybundle needed on the app launch. Then when each level loads each item will make a call to the asset bundle which will be stored in a singleton that will persist through each level. Each item will check each asset bundle for the appropriate model then instantiate it.
Does this seem like a logical way of going about things. I have never used asset bundles before and there seems to be alot of complexity to them especially with the addressable asset bundles which i'm trying to stay away from for now until I get a bit more experience with standard asset bundles.
With regard to keeping track of asset bundle versions, an alternative way of doing it is just to look at the creation time of the local file - if it's older than that of the server file, then you need to download the file again. You only need one server request to do this, if you use an if-modified-since field in the header of the http request.
Your answer
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
Is it posible to tell unity not to compress assetBundles? 2 Answers
Missing textures & materials in asset bundle 1 Answer
Base map problem when loading terrains from asset bundles in build. 1 Answer
Possible to embed local stored assets in a html-page on a webserver? 1 Answer