在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。

How do we use PostAkEventByNameWithDelegate in C++?

+3 投票
I am trying to call PostAkEventByNameWithDelegate, but the signature for the function is not working for me.

Can someone help?

    MyAkComp->PostAkEventByNameWithDelegate( EventName, AkCallbackType::AK_EndOfEvent, &UMyClass::OnDialogEventComplete );

The signature for my OnDialogEventComplete function is:

    UFUNCTION()
        void OnDialogEventComplete( EAkCallbackType CallbackType, class UAkCallbackInfo* CallbackInfo );
最新提问 2月 14, 2019 分类:General Discussion | 用户: Ben H. (250 分)

1个回答

+1 投票
I would really appreciate input on this one, ideally an example of how this is used.

In my code, I have the delegate as a member of my custom sound component, which I pass by reference to the PostEvent function with the callback mask of 0 (which should be EndOfEvent?). I bind a local function using BindDynamic macro on BeginPlay, but my callback never gets triggered.
最新回答 4月 17, 2020 用户: Adrian J. (210 分)
One year later, but just incase other people encounter this issue:

Do not use EAkCallbackType from AkGameplayTypes.h where EndOfEvent = 0 as the Callback mask.

Use AkCallbackType from AkCallback.h where Ak_EndOfEvent = 0x0001 instead.

if you use EAkCallbackType::EndOfEvent
FAkComponentCallbackManager::AkComponentCallback will fail because the pPackage->uUserFlags are 0 instead of 1

Cheers
This sir, you just ended my 8 hour long struggle in header files.
...