A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SoundManager.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Sound/SoundCue.h"
8#include "Engine/DataTable.h"
9#include "SoundManager.generated.h"
10
14USTRUCT(BlueprintType)
15struct FStepVO : public FTableRowBase
16{
18 UPROPERTY(EditAnywhere, BlueprintReadOnly)
20 UPROPERTY(EditAnywhere, BlueprintReadOnly)
21 USoundCue* SoundCue;
22};
23
27USTRUCT(BlueprintType)
29{
31 UPROPERTY(EditAnywhere, BlueprintReadOnly)
32 FText ParameterName;
33 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
34 int32 StoryIndex;
35 UPROPERTY(EditAnywhere, BlueprintReadOnly)
36 UDataTable* DependentSoundTable;
37};
38
42UCLASS()
46
47public:
48 UPROPERTY(EditAnywhere, BlueprintReadOnly)
49 TArray<FSoundManagerParameter> Data;
50};
51
53
57UCLASS(Blueprintable)
58class PIXOCORE_API USoundManager : public UBaseManager
59{
60 GENERATED_BODY()
61
62public:
63 //Manager event declaration
69
70public:
72
79 UFUNCTION(BlueprintCallable)
80 USoundCue* GetSoundBasedOnStep(FText stepName, UDataTable* DataTable);
81 UFUNCTION(BlueprintCallable)
82 void PlaySound(USoundCue* soundToPlay);
87 UFUNCTION(BlueprintCallable)
88 void OnStepChange(FText stepName);
92 UFUNCTION()
93 void OnAudioEndPlaying();
94
95 UPROPERTY(BlueprintReadWrite, Category = "Components")
96 UAudioComponent* AudioComponent;
97 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
98 TArray<UDataTable*> StepVODataTablesArray;
99 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
100 TArray<UDataTable*> StepHintVODataTablesArray;
101 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
102 USoundManagerParametersData* SoundManagerParametersData;
104 UPROPERTY(BlueprintReadWrite, Category = "Components")
105 UDataTable* CurrentStepVODataTable;
106 UPROPERTY(BlueprintReadWrite, Category = "Components")
107 UDataTable* CurrentStepHintVODataTable;
108 UPROPERTY(BlueprintAssignable)
109 FOnVOEndPlaying OnVoEndPlaying;
110
111protected:
112 UPROPERTY()
113 USoundCue* ActiveSound;
114 FText CurrentStep;
115};
#define DECLARE_EVENT_HANDLER(TEvent)
Definition BaseManager.h:11
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnVOEndPlaying)
It provides functionalities for handling events, sending events, and managing a private owner....
Definition BaseManager.h:32
Event used to call when hint activated or deactivated.
Event called when we on init experience.
Event called when new step is loaded.
Event called when new story is loaded.
Event used to call to play sound.
Manager that provides functionality for managing VOs and Hint VOs. To use this class you must attach ...
DECLARE_EVENT_HANDLER(UNewStepLoadedEvent)
USoundCue * ActiveSound
UPROPERTY()
TArray< UDataTable * > StepVODataTablesArray
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UNewStoryLoadedEvent)
DECLARE_EVENT_HANDLER(UInitializationEvent)
FOnVOEndPlaying OnVoEndPlaying
UPROPERTY(BlueprintAssignable)
UAudioComponent * AudioComponent
UPROPERTY(BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UPlaySoundEvent)
UDataTable * CurrentStepHintVODataTable
UPROPERTY(BlueprintReadWrite, Category = "Components")
TArray< UDataTable * > StepHintVODataTablesArray
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UHintActivatedEvent)
USoundManagerParametersData * SoundManagerParametersData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
UDataTable * CurrentStepVODataTable
UPROPERTY(BlueprintReadWrite, Category = "Components")
Represents a data asset containing Sound Manager parameters. Setup this data asset if you want to hav...
TArray< FSoundManagerParameter > Data
UPROPERTY(EditAnywhere, BlueprintReadOnly)
Represents a parameter used by the Sound Manager that will be passed as you load story.
int32 StoryIndex
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
FText ParameterName
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UDataTable * DependentSoundTable
UPROPERTY(EditAnywhere, BlueprintReadOnly)
Represents a Step Value Object used for storing step data in a data table.
USoundCue * SoundCue
UPROPERTY(EditAnywhere, BlueprintReadOnly)
GENERATED_BODY()
FText StepName
UPROPERTY(EditAnywhere, BlueprintReadOnly)