版本
menu_open
Wwise Unity Integration Documentation
Spatial Audio 教程准备工作

为了成功完成 Surface Reflector 教程Room 和 Portal 教程 ,请务必执行以下步骤:

1. 创建 Unity 工程

安装最新版本的 Wwise 和 Unity,并按照以下步骤构建工作环境。

  1. 启动 Unity 并创建一个新的工程。
  2. 关闭 Unity。
  3. 启动 Wwise Launcher 并将 Wwise 集成到 Unity 工程中

2. Wwise 工程准备工作

对于所述教程,您需要添加 Sound SFX,然后创建用于播放的 Event,并生成 SoundBank。

  1. 启动 Launcher,并选择在 Wwise 中打开工程。
  2. 在 Actor Mixer Hierarchy 的 Default Work Unit 下添加 Sound SFX。在 Wwise Integration 工程中,我们添加了一个对白声音。
    1. 为其导入声音。
    2. 打开 Sound Property Editor:
      1. 在 General Settings 选项卡中,选中 Use game-defined auxiliary sends。<br>
        SoundPropertyEditorGeneralSettings.png
        Sound Property Editor General Settings tab
      2. 在 Positioning 选项卡中,选中 Listener Relative Routing,并将 3D Spatialization 设为 Position + Orientation。也可以添加 Attenuation。<br>
        SoundPropertyEditorPositioning.png
        Sound Property Editor Positioning tab
  3. 右键单击 Actor-Mixer Hierarchy 中的 Sound SFX,然后依次选择 New Event > Play 。<br>
    EventEditor.png
    Event Editor
  4. 转到 SoundBank 布局(快捷键 F7),并添加新的 SoundBank。将 Event 拖入新的 SoundBank。Wwise Integration 工程中的 SoundBank Manager 应如下图所示:

    SoundBank.png
    SoundBank Manager and Editor
  5. 保存工程。

3. Unity 工程准备工作

在本节中,我们将创建游戏区域及其中的对象。我们需要设置听者、发声体和两个房间。首先,启动 Launcher 并选择在 Unity 中打开工程。然后,打开 Wwise Picker (Windows > Wwise Picker),点击 Refresh Project,然后选择 Generate SoundBanks。<br>

WwisePicker.png
Wwise Picker

3.A. 环境

  1. 使用 Cube 创建 Floor、Wall 和 Ceiling: GameObject > 3D Object > Cube
    Object Name Position Rotation Scale
    Floor (0, 0, 0) (0, 0, 0) (50, 0.5, 50)
    Wall Front Left (-4.5, 3, -10) (0, 0, 0) (7, 6, 0.5)
    Wall Front Middle (0, 5, -10) (0, 0, 0) (2, 2, 0.5)
    Wall Front Right (2.5, 3, -10) (0, 0, 0) (3, 6, 0.5)
    Wall Left Small (-7.75, 3, -6) (0, 0, 0) (0.5, 6, 8)
    Wall Back Small (-2, 3, -2) (0, 0, 0) (12, 6, 0.5)
    Ceiling Small (-2, 5.75, -6) (0, 0, 0) (12, 0.5, 8)
    Wall Right Small (3.75, 3, -8) (0, 0, 0) (0.5, 6, 3.5)
    Wall Front Large (11.5, 3, -7.5) (0, 0, 0) (16, 6, 0.5)
    Wall Right Large (19.25, 3, 3.25) (0, 0, 0) (0.5, 6, 21.5)
    Wall Middle (3.75, 5, -4.5) (0, 0, 0) (0.5, 2, 3.5)
    Wall Left Large (3.75, 3, 5.625) (0, 0, 0) (0.5, 6, 16.75)
    Wall Back Large (11.5, 3, 14) (0, 0, 0) (16, 6, 0.5)
    Ceiling Large (11.5, 5.75, 3.25) (0, 0, 0) (16, 0.5, 22)
    Barrier (-4.5, 3, -17) (0, 0, 0) (7, 6, 0.5)
  2. 在房间内添加 Spotlight ( GameObject > Light > Spotlight )。
    Object Name Position Rotation Scale
    Spotlight Small Room (-3, 5.75, -6) (0, 0, 0) (1, 1, 1)
    Spotlight Large Room (11.5, 5.75, 5) (0, 0, 0) (1, 1, 1)
    1. Light 组件中,更改以下参数:
      1. Range 设为 30。
      2. Spot Angle 设为 179。

3.B. 角色听者

  1. 根据需要自行创建一个角色。
    Object Name Position Rotation Scale
    MainCharacter (0, 1.3, -20) (0, 0, 0) (1, 1, 1)
    1. 移除所有 Unity Audio Source。
    2. Ak Audio Listener 组件添加到镜头。<br>
      AkAudioListener.png
      Ak Audio Listener component
    3. Ak Spatial Audio Listener 组件添加到镜头。<br>
      AkSpatialAudioListener.png
      Ak Spatial Audio Listener component

3.C. 第三人称发声体

  1. 使用 Cylinder 创建 Button ( GameObject > 3D Object > Cylinder )。
    Object Name Position Rotation Scale
    Button Outside (-3, 0.75, -15) (0, 0, 0) (0.15, 0.5, 0.15)
    Button Small Room (-3, 0.75, -5) (0, 0, 0) (0.15, 0.5, 0.15)
    Button Large Room (7.5, 0.75, 5) (0, 0, 0) (0.15, 0.5, 0.15)
  2. 添加 Ak Spatial Audio Emitter 组件。
    AkSpatialAudioEmitterDefault.png
    Ak Spatial Audio Emitter component
  3. 在 Ak Game Obj 组件中:
    1. 选中 Environment Aware 选项。
    2. 选中 Use Default Listener 选项。
      AkGameObj.png
      Ak Game Obj component
  4. 添加 Ak Ambient 组件:
    1. Trigger On 中选择所需声音触发方式。
    2. Event Name 中选择 Play_sound 事件。
      AkAmbient.png
      Ak Ambient component
  5. 添加 Ak Bank 组件:
    1. 2. Wwise 工程准备工作 中创建的 SoundBank 添加到 Bank Name
      AkBank.png
      Ak Bank component
  6. 启动游戏并连接到 Wwise,然后打开 Profiler 布局(快捷键 F6)。
  7. 播放 Button 声音。此时,应会听到 Wwise 工程中导入的声音。
  8. 在 Voices Graph 选项卡中,应会看到以下声部图。
    VoiceGraph.png
    Button Outside Voice Graph with no Effect

3.D. 场景

  1. 将场景保存到合适位置。
  2. 下图中显示了最终创建的场景。Unity Integration 文件包中提供有此场景。为方便起见,场景中的元素具有各种颜色。另外,还添加了第一人称控制器使其可以移动。
    SceneComplete.png
    Tutorial Unity Scene

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅