menu
 
版本
2024.1.5.8803

2024.1.5.8803

2023.1.13.8732

2022.1.19.8584

2021.1.14.8108

2019.2.15.7667

2019.1.11.7296

2018.1.11.6987

2017.2.10.6745

2017.1.9.6501

2016.2.6.6153

2015.1.9.5624


menu_open
Wwise Unity Integration Documentation
安装 Wwise Unity Addressables Package

Using the Wwise Addressables Installer

For Wwise 24.1.2 and 23.1.10 and above, the Wwise Addressables Installer is available, which will automatically handle the installation/uninstallation process.

通过 Unity Package Manager 和 GitHub 安装 Wwise Addressables Package

Wwise Addressables Package 的官方存储目录为 https://github.com/audiokinetic/WwiseUnityAddressables

  1. 在 Unity Editor 中,依次选择 Window > Package Manager
  2. 单击 + 并选择 Add package from git URL

如需进一步了解如何使用 Git 存储库中托管的数据包,请参阅 Unity 文档

info备注:若显示 No "git" executable was found 错误消息,则须将 git.exe 可执行文件存储目录添加到系统环境,并在必要时重启系统以使更改生效。
info备注:为确保能够正常使用 Wwise Addressables,须同时将 Unity Addressables Package 添加到工程中。该数据包被列为 Wwise Addressables Package 的依赖项,应当会自动安装。

更新 Wwise Unity Addressables Package

在更新到新的 Wwise 版本时,建议先更新 Unity 集成,再更新 Wwise Unity Addressables Package。

在发布 Wwise 小版本或大版本的同时,也会发布对 Wwise Unity Addressables Package 的更新。不过,不一定要那么频繁地进行更新。每项更新都标记有发布和测试时使用的 Wwise 版本。我们的目的是保证新的 Unity 集成版本和老的 Wwise Unity Addressables Package 版本之间的兼容性(除非需要实施重大更改)。比如,Wwise Unity 集成 2021.1.7 及更高版本跟 21.1.7 标签之前的 Wwise Unity Addressables Package 版本之间是不兼容的。每个 GitHub 标签在存储库的版本页面上都有一个对应的条目,其描述了所作的更改以及版本兼容性。

与 Unity Addressables Package 的兼容性

Wwise Unity Addressables Package 应当与最新的 Unity Addressables Package 版本兼容。而且,跟老的版本应当也兼容。不过,1.16.0 之前的版本并未经过测试。在默认情况下,Wwise Unity Addressables Package 使用针对 Unity 集成支持的最低 Unity 版本验证的最新版本 Addressables Package。有关支持的 Unity 版本列表,请参阅 版本说明 - Wwise Unity 集成 2024.1.5 章节。

使用 Wwise Addressables Package 设置并构建脚本

步骤 1:在 Project Settings > Wwise Integration > Generated SoundBanks Path 中,设置所生成 SoundBank 的目标目录。

warning注意: 为了确保能够正常导入 SoundBank,请务必将此目录设在 Assets 文件夹内。
  • 在本例中,我们将目标目录设为 Assets\WwiseData\Banks
  • 若更改此路径,则将自动修改 Wwise 中的输出目标目录。
  • 在执行此更改后打开 Wwise 设计工具时,将显示对话框并提示重新加载工程。
info备注:When the target directory is changed in the Unity Wwise Project Settings, the Output Path for the external sources won't be adjusted automatically in the Wwise Project. If necessary, make sure to adjust it based on the changes made for the Root Output Path.

步骤 2:在 Wwise 设计工具内或使用 Wwise Picker 生成 SoundBank。

  • 这时 .bnk 和 .wem 文件的自定义素材导入程序将创建与所生成 SoundBank 和流播放媒体文件对应的 Unity 素材。
  • AddressableAssetsData 目录下会自动生成元数据文件和平台专用分组。
  • 您可以通过检查 Generated SoundBanks Path 下的文件来确认是否正确导入了素材。
  • 有关更多详细信息,请参阅 Understanding Wwise Addressable Assets 章节。

步骤 3:依次单击 Window > Asset Management > Addressables > Groups。这时将打开 Wwise Addressables Groups 窗口。

在默认情况下,会针对每个部署平台创建一个包含平台专用 SoundBank 素材的分组。 另外,还会针对每个部署平台创建仅包含 Init SoundBank 的单独分组。

若检视场景中的 WwiseGlobal 对象,会发现其添加了 Init Bank Holder 组件。

info备注:The Init Bank Holder will only be added to the currently open scene. If the project contains multiple scenes, make sure all the scenes have been opened and saved, or alternatively, use the script under Tools > Reload All Scenes.

步骤 4:为 Addressables 创建 Wwise Build Script。

  • 建议将其与默认构建脚本一并放在 AddressableAssetsData/DataBuilders 下。
  • 在浏览器中任意位置右键单击,并依次选择 Create > Addressables > Content Builders > Wwise Build Script
  • 这时将创建名为 BuildScriptWwisePacked 的素材。

步骤 5:检查 Addressables 设置。

  • 在默认情况下,其位于 AddressableAssetsData/AddressableAssetSettings
  • 从 Addressables Groups 窗口:Tools > Inspect System Settings
  • 从 Unity Editor:Window > AssetManagement > Addressables> Settings

步骤 6:将 BuildScriptWwisePacked 添加到 Addressables 构建脚本。 在 AddressableAssetSettings 所对应的 Inspector 中,将步骤 4 创建的 BuildScriptWwisePacked 素材添加到 Build and Play Mode 脚本。

构建工程

您可以在 Addressables Groups 窗口中使用 Wwise Build Script 构建 Addressables 素材包。 这样会在 Library\com.unity.Addressables\StreamingAssetsCopy\aa\<Platform Name> 下生成所有通用素材包(如 Default Local Group)及平台专用素材包。

warning注意: Wwise Build Script 会修改 WwiseData 分组架构的 Include in Build 属性。 若分组名称中带有 WwiseData,则只有该名称同时带有目标构建平台名称才会将其包含其中。 您可以在 BuildScriptWwisePacked.cs 脚本中修改此行为。 若要通过 Include in Build 属性手动控制将哪些分组包含在内,则可直接使用默认构建脚本。

一旦完成 Addressables 素材构建,就可以照常构建工程了。

warning注意: 在修改工程或向其添加新的 SoundBank 后,须重新构建 Addressables 分组。 此外,在切换平台后也要重新构建 Addressables 分组。

在构建目录下:

  • Addressables 素材包将被复制到 StreamingAssets\aa\

移除 Wwise Addressables Package

在移除此数据包后,需执行一些附加步骤来确保 Wwise Integration 能够正常工作。

  • 从 Unity 素材文件夹中移除包含所生成 SoundBank 的文件夹。Make sure to delete the .meta file associated with the folder as well.
  • 通过 Unity Package Manager 卸载数据包,或删除 <UnityProject>\Packages\manifest.json 文件中的对应行。
  • 在 Wwise Project Settings 中,将 SoundBank Paths 设为 Assets 之外的路径。
  • 重新生成 SoundBank。
  • 若仍使用 Unity Addressables Package,请务必清理 Addressables 分组。

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅