PostEventAtLocationAsync.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #pragma once
  16. #include "AkAudioDevice.h"
  17. #include "Kismet/BlueprintAsyncActionBase.h"
  18. #include "PostEventAtLocationAsync.generated.h"
  19. DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FPostEventAtLocationAsyncOutputPin, int32, PlayingID);
  20. UCLASS()
  21. class AKAUDIO_API UPostEventAtLocationAsync : public UBlueprintAsyncActionBase
  22. {
  23. GENERATED_BODY()
  24. public:
  25. UPROPERTY(BlueprintAssignable)
  26. FPostEventAtLocationAsyncOutputPin Completed;
  27. UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic", meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"))
  28. static UPostEventAtLocationAsync* PostEventAtLocationAsync(const UObject* WorldContextObject, class UAkAudioEvent* AkEvent, FVector Location, FRotator Orientation);
  29. public:
  30. void Activate() override;
  31. private:
  32. UFUNCTION()
  33. void PollPostEventFuture();
  34. private:
  35. const UObject* WorldContextObject = nullptr;
  36. class UAkAudioEvent* AkEvent = nullptr;
  37. FVector Location;
  38. FRotator Orientation;
  39. TFuture<AkPlayingID> playingIDFuture;
  40. FTimerHandle Timer;
  41. };