Let's talk about the Wwise Unity Integration. There are quite a few educational resources that have been created over the years, which are always available for reference. To mention Audiokinetic resources, there are many videos on youtube, plenty of questions answered in detail on the Audiokinetic Q&A, there's also the Wwise-301 course, and of course the Wwise Unity Integration documentation.
All of this is great to get you started, however, once you've gone through learning material, it's at times overwhelming to search through page after page for the name of that reverb zone component. And even when you've learned how to use the Wwise Unity Integration, you may still have question at times.
How do I write a Wwise-Type event properly?
What is the name of that spatial audio reverb zone component?
Which is called first, OnTriggerEnter() or Update()?
Should I use an AkEvent or AkAmbient to post events?
What do I need to input to a callback function, again?
Many of us tend to have old projects located within reach, where we can revisit those good old scripts with all the neat functions we've already created to reuse in newer projects with slight modifications. Many of us have probably created our own manager scripts for better naming conventions while also collecting multiple functions that we prefer not writing again. And, while trying to grab old code, you might even find yourself questioning whether it would have been a better idea to start from scratch!
Here's a proposal. Let's share notes and build a Cheat Sheet with all kinds of goodies for speeding up your Wwise Unity development process, but keep it handy and manageable by limiting it to one page.
What to add to a Cheat Sheet
Before I present my proposal of a Cheat Sheet, here are some of my considerations when building one.
Is it going to help in the long run? Will this be applicable to any project? Event names or hierarchical structure might change completely on upcoming projects, so it might make sense to simplify it or even remove custom functions that wouldn't be available on other projects. Hopefully, this will save time spent on maintaining the Cheat Sheet, with the added bonus of shareability.
The same applies for referencing features across versions. For example, the Wwise Editor settings in Unity recently moved to Unity > Edit > Project Settings, so having a helpful path to your Wwise Unity Integration settings might not be valid with older Wwise versions.
The Cheat Sheet’s most fundamental purpose is to reduce the time spent searching for answers. Adding something like the complete list of Unity's Event functions, as an example, might add complexity without being beneficial when you need to look something up. Similarly, consider keeping it clean from fancy imagery and visual effects, keeping it intuitive to navigate, even for a colleague who might decide to "borrow" your Cheat Sheet indefinitely.
As I am creating this one for working partly in Unity, generic Unity notes might come in handy too, such as pressing F in the scene view in order to focus on a game object. In fact, a common method for playing an ambiance in a region is to use an AkAmbient component with a Unity Trigger, and so naturally, you would need to know how Triggers work.
With all that said, here's my suggestion of a Cheat Sheet.
Wwise Unity Cheat Sheet
Please open this document, save a copy of it, and feel free to make it your own!
I’ve intentionally created my Cheat Sheet using the web-based Google Drawing software, so that you can access the file from your browser and make a copy to your own drive. Once in your drive you will then be able to modify each and every shape or text field to your liking.
For your convenience, I hooked up quite a few terms, functions, etc., with links that also work if you download it as PDF. This way, you can store it locally and have it open in a separate window, on your iPad or displayed on a secondary monitor. Having created it to be easily modified, we'll definitely update this with newer versions of the Wwise Unity Integration. Feel free to save it, modify it and share it anywhere you like.
Tips And Tricks not found in the Cheat Sheet
Let’s talk about the things that don't necessarily make sense to put in a cheat sheet, but are helpful reminders anyway. An example of a helpful reminder is that you can add another inspector view in order to see two components at the same time, even from two different game objects. Though the steps that are taken to prepare your Unity project are important, they might not make sense as items on the sheet, because they are a one-time-use task that won’t be helpful to the rest of your development.
Despite not adding many of these reminders to our Cheat Sheet, let me share a few of them with you anyway. If I've missed any helpful tips, I put my trust in the fantastic Wwise community to let me know in the comments section of this blog below!
In or Out of Playmode
You enter playmode when you are ready to try your game in Unity. However, the condition of being "in playmode" or "not in playmode" is not particularly clear by default in my opinion, other than a small button being pressed and highlighted.
To help add clarity to what mode you are in, you can add a color overlay that clearly identifies what condition you're currently in through Unity's Preferences > Colors > Playmode tint.
That said, should you have made some changes while in playmode anyway, you can copy your component in the gear icon, exit playmode and then paste the component values to keep your work.
Viewing Multiple Inspectors at Once
Similar to Wwise, you can rearrange the views in Unity to your liking. However, did you know that you can have multiple inspector views open at once? In fact, this is quite common if you are using multiple cameras, as you can simply add another Game view and assign a different camera. A Wwise Unity developer can use this to view multiple game objects at once, which allows for comparing the settings of your Wwise Unity Integration components. To set this up, right click the Inspector pane > Add Tab > Inspector.
Then, lock ONE of your inspector windows …
… and select another game object.
Searching for Components on Game Objects
It's easy to lose track of what game objects you've been modifying and which you haven't after days of audio integration. There are ways to find all your component hooks across all game objects in the scene. Topmost in Unity's Hierarchy view, search for the name of any component, like 'AkEvent'. This will quickly filter out any game objects that don't meet that requirement so you can see each game object with that component on it.
These are my top tips when working with the Wwise Unity Integration, and I'm sure you've got some great tips as well! I certainly hope you'll be able to make use of the Wwise Unity Cheat Sheet, or enjoyed reading some of these tips. Make sure to share your own notes here in the comments, on social media and remember to tag us with @audiokinetic and hashtag #Wwise so we can follow your awesome work.