버전
menu_open

Making DLCs with Wwise and Unity

Using Wwise File Packages

The default way to support DLCs with Wwise is to use File Packages. This is explained in part in the Authoring documentation: Wwise > Help > Finishing Your Project > Managing File Packages > Downloadable Content Overview. The short explanation is that these packages can contain BNK and WEM replacement or additional files, and they can be loaded and unloaded at will to enable or disable the DLC. This package format is optional, but it is currently built-in the Wwise/Unity plug-in. If you want to write your own package format, you'll need to write a new Low-Level IO to replace the default one.

To use packages in Unity, you simply have to place them in the Base Path, the path where your banks are, as defined in AkInitializer's properties. Then call AkSoundEngine.LoadFilePackage(). Wwise will always try to load files through the file packages first, in the reverse order (last added is the first searched).

This method will work on all platforms that allow you to write on disk, into your Base Path, after the game is shipped. This is unfortunately not the case with iOS and Android.

On Android and iOS, since all the data is bundled into a read-only file system, you will need to put your packages in a different directory. This is done by calling AkSoundEngine.AddBasePath(), before AkSoundEngine.LoadFilePackage(). You can add multiple paths, the last added will be searched first. Please check the appropriate Operating System documentation to find what are the restrictions. The code below is an example of code to select a path where you can store your files:

#if UNITY_IPHONE            
    string fileNameBase = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf('/'));
    fileName = fileNameBase.Substring(0, fileNameBase.LastIndexOf('/')) + "/Documents/" + FILE_NAME;
#elif UNITY_ANDROID
    fileName = Application.persistentDataPath + "/" + FILE_NAME ;
#else
    fileName = Application.dataPath + "/" + FILE_NAME;
#endif

Note that there are several other writable paths on Android, such as the SD card or similar storage devices.

See also:

Streaming banks from Unity WWW service

It is also possible to use the WWW class from Unity to get your DLC audio files and load them directly. This is done through in-memory loading of banks, as demonstrated in AkMemBankLoader.cs. If you are replacing existing banks with new ones, you must take care of properly unloading the previous banks first; the Wwise IO system would be unaware that code so it can't know if you're reloading the same bank by mistake or want to replace it.

Generated on Tue Aug 23 02:44:59 2016 for Wwise Unity Integration by  doxygen 1.6.3

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요