Download Resources zip from server issue

I use WWW to download zip from my server. I want to save the zip to Application. persistentDataPath. The zip can be saved to that path. But I hope the result that save the Assets folder. The zip content will be replaced the old resources.
I don’t know how to do it? Please help. Thanks.

ps: I am testing in mobile

You can’t remove/replace the assets from the assets folder in a build. If you want to replace them, then you can use asset bundles. I have a project that uses them and I can swap out one bundle for another to replace the assets.

Thanks for your reply.

I just find some asset bundle reference. I can’t understand how to replace the old assets.

Could you give me some tutorial or code.

Thanks.

Depends on the assets used. If you are replacing them with different assets with different names then it won’t work.
I have 8 asset bundles that have the same number of sprites and all sprites are the same names across all of the bundles.

For example:
Asset Bundle 1 contains sprite1, sprite2, and sprite3
Asset Bundle 2 contains sprite1, sprite2, and sprite3

All the sprites are different only named the same.

I have a reference to the loaded assetBundle.

I load them from a folder/web using WWW.LoadFromCacheOrDownload it speeds up loading if its cached already.

You don’t need to have a zip file as the assetBundle is pretty much that so you can grab that from the server instead of the zip, and with caching it the user doesn’t need to download it every time.

If I have one loaded I call assetBundle.Unload(true); Before loading the new one. I then make the newly downloaded assetBundle be the loaded assetBundle reference so I can unload it when needed.

I don’t have any of the sprites being used when I load and unload them so I don’t get any errors. I change nothing with any of the objects using the sprites as its referencing the name and will look for a sprite with that name.

Hope that helps.

I would like to ask a question.

I downloaded asset bundle plugin in asset store. I clicked build asset bundle button. But no any response. But I import asset bundle sample to my project. Then I clicked the build asset bundle button. It can be built asset bundle. But I can’t build my own object to asset bundle.
Thanks.