Version
- iOS
The GME Unity SDK is bundled with a sample game, which you can examine to understand how to use GME in a Unity project. It is located in the following directory:
<WWISE_INSTALL_PATH>/SDK/plugins/TencentGME/Unity/GMEWwiseDemo
Copy the project to a location where your user has write access, for example
C:/Users/<YourUser>
. Before you can use the demo game, you must
integrate Wwise through the Audiokinetic Launcher to copy the Wwise SDK with the Tencent GME In-Game Voice Chat. Refer to Wwise Unity Integration.
Note | |
---|---|
The Wwise sample project was created with Unity 2021.3.0f1. You must first upgrade the project to your Unity version before you integrate Wwise into it. The upgrade has been tested with Unity 2022.2.13f1. |
First, copy the Wwise project provided for the GME Integration Demo Wwise project next to the demo game. It is located in the following folder:
<WWISE_INSTALL_PATH>/SDK/samples/Plugins/TencentGME/IntegrationDemo/WwiseProject
Next, set the paths to the Wwise project and your Wwise installation in the Wwise settings (Edit > Project Settings) and go to Wwise Editor settings. The settings should resemble the following:
Next, copy the GeneratedSoundBanks directory from the GME Integration Demo Wwise project to the specified location in the SoundBanks Path field, for example:
<UNITY_PROJECT>/Assets/StreamingAssets/Audio
Finally, set events and SoundBank elements from the Wwise project into Unity components.
The Main Scene has check boxes for posting events controlled by the Main Scene script component on the Canvas object. Set the Wwise Events and Sound Banks as follows:
Note | |
---|---|
If the events do not appear, the Wwise project might not have been read by Unity yet. To force a refresh, click Refresh Project in the Wwise Picker window (Window > Wwise Picker). |
There are two scenes: the first one shows how to set the GME initial parameters, and the second one shows the GME features. The related source files are located in the following locations:
Demo scenes: Assets\Scenes
Demo scripts: Assets\Scripts
AuthScene.cs
provides a user interface in which you can specify the
OpenID (also known as the User ID) and the RoomID for the session.
In Assets/Scenes
open AuthScene.cs
, click the WwiseGlobal
object in the Hierarchy, and verify
WwiseGlobal
has the AKInitializer.cs
script as shown below:
MainScene.cs
contains the main script to post GME-related Wwise events to
enable voice chat.
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise