Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
I am pretty new to wwise & unity integration and I am unable to figure something out. I get that there is Ak Timeline Event Track & Ak Timeline RTPC Track, but how am I supposed to set some switches? For example: I've got an Impact event that works with couple of switches (weapon type, surface type etc.) so I guess it would be convenient to set those up on a timeline track to post an event when all the switches are set up properly. I know that I probably can workaround this by using timeline signals and setting AkSwitch manually but it seems really tedious.

I would really appreciate any hints about that.
in General Discussion by nehvaleem (140 points)

1 Answer

0 votes

Hey nehvaleem, yeah timeline signals kind of suck. "Markers" are really the way to go, but you have to learn how to set them up. 

Here is an example for a Wwise Switch - I haven't tested it out, but I think it should work (we don't really use Switches in our project so don't have anything to test it on easily). With Markers, you can use "Exposed References" to link up to stuff that exists in your current Scene (the "exposed audio source game object"):

using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;

[CustomStyle("WirelessSignal")]  //<-------Use this to create a custom icon for the Marker, see below
public class Marker_AudioSwitch : Marker, INotification
{

    public PropertyName id => new PropertyName();

    public AK.Wwise.Switch akSwitch;
    [SerializeField] public ExposedReference<GameObject> exposedAudioSourceGameObject;

    public void Activate(Playable origin) {
        GameObject resolvedAudioSourceGameObject = exposedAudioSourceGameObject.Resolve(origin.GetGraph().GetResolver());
        akSwitch.SetValue(resolvedAudioSourceGameObject);
    }
}

 

To use a custom icon for the Marker you have to set up a file called "common.uss". I can't remember exactly, but you may have to place the common.uss file inside of a folder structure like this:

Editor > StyleSheets > common.uss

Then here is an example of what would be inside of the common.uss file, in order to set up one icon (they can have different versions for "hover" and "checked" etc, so that when you click on it it changes color, or whatever you want it to do:


WirelessSignal
{
    width: 20px;
    height: 20px;
    background-image: resource("Assets/Cutscene/Editor/WirelessSignal - dark.png");
}
 
WirelessSignal:checked
{
    width: 20px;
    height: 20px;
    background-image: resource("Assets/Cutscene/Editor/WirelessSignal - dark.png");
}
 
WirelessSignal:hover:focus:checked
{
    width: 20px;
    height: 20px;
    background-image: resource("Assets/Cutscene/Editor/WirelessSignal.png");

}
 

And then place the images you want for the icon at those locations (like how mine is assets/cutscene/Editor). I think the icons need to be in a folder called "Editor".

Hope this helps!

by James M. (800 points)
...