Community Q&A

Where Wwise users help each other out!

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

Does anyone have an example of Unity Callbacks I can use to trigger one event after another?

0 votes
I'm new to C# and was looking to trigger an event on object b after a different event completes on object A. Like an explosion sound triggering on a cube after a line of dialog on a player. Any help would be appreciated!

 

I
asked Mar 2, 2017 in General Discussion by Chris F. (100 points)

2 Answers

0 votes
I would also like to know how this works. Please let me know if you have figured this out!
answered Jun 25, 2017 by Aaron I. (220 points)
0 votes
Something like this could work for you:

public void EventWithCallback(string eventName)

{

AkSoundEngine.PostEvent(eventName, gameObject, (uint)AkCallbackType.AK_EndOfEvent, EventCallback, this);

}

 

private void EventCallback(object in_cookie, AkCallbackType in_type, object in_callbackInfo)

{

if (in_type == AkCallbackType.AK_EndOfEvent)

{

// trigger second event here

}

}
answered Feb 20, 2019 by Alexander H. (260 points)
...