版本
menu

Wwise Unity Integration Documentation
Developing DLC with the Wwise Unity Integration

This section lists several important requirements and recommendations to remember if you plan to release downloadable content (DLC) for your game.

Working with DLC in Wwise Authoring

When working on DLC in Wwise Authoring, you can add new DLC-specific sound structures and Wwise assets, or add child elements to existing structures such as Switch Containers, Music Playlist Containers, and so on. Depending on the type of object you modify, you must then either repackage the affected SoundBanks or add new SoundBanks. For details and examples of SoundBank management for DLC in Wwise Authoring, see DLC considerations and limitations.

Additionally, when working with media files in your project, ensure that there are no conflicts between DLC and base game asset ShortIDs. For more information, see Short IDs in action.

Packaging DLC

A major part of DLC development is packaging and distributing DLC-specific SoundBanks and media files. There are several ways to do so with the Wwise Unity Integration.

Using Addressables

We recommend that you use the Unity Addressables system to manage your DLC sounds. You can use the Addressables system to package DLC assets, including Wwise assets, into separate bundles that can be delivered apart from the base game.

For more information, see DLC Packaging Tutorial.

Using Wwise File Packages

If you are not using the Addressables system, you can use the Wwise File Packager to create DLC-specific packages. For detailed instructions, see Packaging DLC files.

In short, these packages can contain new or replacement BNK and WEM files, which can be loaded and unloaded to enable or disable the DLC. This package format is optional, but it is built into the Wwise Unity plug-in. To write your own package format, you need to write a new Low-Level I/O to replace the default one.

To use packages in Unity, place them in the Base Path defined in the Initialization Settings (see 调整 Wwise Initialization Settings), which contains your SoundBanks. Next, call AkUnitySoundEngine.LoadFilePackage(). Wwise attempts to load files through the file packages first, in reverse order (most recently added is the first searched). This method works on all platforms that allow you to write to disk, into your Base Path, after the game is shipped.

Unfortunately, you cannot use this method on iOS or Android. On these platforms, all data is bundled into read-only file systems, so you must put your DLC packages in different directories. To do so, call AkUnitySoundEngine.AddBasePath() before AkUnitySoundEngine.LoadFilePackage(). You can add multiple paths. The last path you add is searched first. See the appropriate operating system documentation for any additional restrictions.

The following code is an example of how to select a path in which to 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

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

参见

Streaming SoundBanks with UnityWebRequest

You can use the UnityWebRequest class from Unity to obtain and load DLC audio files in memory, as demonstrated in AkMemBankLoader.cs. If you are replacing existing banks with new ones, you must unload the previous banks first because the Wwise I/O system cannot determine which is the correct bank to load.


此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅