0
\$\begingroup\$

I am developing a game in Unity 2019. The instructions of the game must be translated into several languages. Currently they are part of the compilation, but this makes the compilation very large.

I would like, according to the selected language, to be able to download the corresponding audio and cache it.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ What have you tried? Have you searched about downloading assets using Unity? That way you can use them the same way as local assets. \$\endgroup\$ Sep 2, 2019 at 18:30
  • \$\begingroup\$ Hello @TomTsagk. The resources that I use are the ones that I have in the project, I need to be able to download the audio resources remotely and that they are stored in the device so as not to have to download them again, but I have not found documentation on this. \$\endgroup\$ Sep 2, 2019 at 18:38
  • \$\begingroup\$ I just searched for "Unity download remote file" and got plenty of promising results. Did any of them work for you? \$\endgroup\$ Sep 3, 2019 at 9:03

2 Answers 2

1
\$\begingroup\$

Old question, but the current official best practice is to use Unity's Addressable Asset System to manage and asynchronously load asset packages from any location and with any collection of dependencies. The addressable system is built on top of AssetBundles, and while a bit of a steep learning curve at first, in my experience it is flexible and robust in action.

\$\endgroup\$
0
\$\begingroup\$

https://docs.unity3d.com/ScriptReference/WWW-audioClip.html https://forum.unity.com/threads/download-and-save-www-mp3-file.409470/

these are what you are looking for. but WWW is being deprecated. just try to find UnityHttpRequest replacement solution for this. in these threads you problem is dicussed well.

you can check if you have that file in your device. if there isnt, so you have to get it from server.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This answer would benefit from a working example or walkthrough of the process to create one, rather than just links to the component parts. \$\endgroup\$
    – DMGregory
    Sep 2, 2019 at 20:32
  • 1
    \$\begingroup\$ I would recommend using an AssetBundle instead of downloading individual audio clips, partly because Unity has AssetBundle caching built in. \$\endgroup\$
    – Ed Marty
    Sep 3, 2019 at 12:27
  • \$\begingroup\$ @EdMarty yes. good suggestion. you can update the answer if you want. \$\endgroup\$
    – virtouso
    Sep 3, 2019 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .