Hello Benedict,
Originally, I advised you to use Wwise-Types, but that was a mistake. Wwise-type States are just specific State values and so there's no GetValue or GetState function on it. That said, you can still create two Wwise-type States, which would give you the pickers in the Inspector, and then get the Group ID from it. Something like this...
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SomeScript : MonoBehaviour
{
public AK.Wwise.State State01;
public AK.Wwise.State State02;
private void Start()
{
// If not set, the initial State will be "None".
State01.SetValue();
}
void Update()
{
// Button input check
if (Input.GetKeyDown(KeyCode.Space)) {
uint currentState = 0; // variable to store the ID in.
// Since the Wwise-types only refer to specific state values,
// you will need to AkSoundEngine.GetState() to get the global one.
// That said, you can still use the ID from the Wwise-Types.
AkSoundEngine.GetState(State01.GroupId, out currentState);
print(currentState); // just delete if you've tested it out.
if (currentState == State01.Id)
{
State02.SetValue();
print("Set State02"); // just delete if you've tested it out.
}
else if (currentState == State02.Id)
{
State01.SetValue();
print("Set State01"); // just delete if you've tested it out.
}
}
}
}
As for the 'out uint out_rState' you just need to declare a uint property first, so you can store the value you get back. That value will be the ID of that State, and you can e.g. use it to search in your SoundBank.txt file and see what specific State it is.