5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
7#include "SplineSoundComponent.generated.h"
9UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
10class PROJECTX_API USplineSoundComponent :
public UActorComponent
16 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
17 class USoundBase* Sound;
19 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
20 class USoundAttenuation* AttenuationSettings;
22 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
23 float InactiveTickInterval = 1.0f;
25 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
26 float ActiveTickInterval = 0.1f;
28 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
29 float ActivationFadeInTime = 0.5f;
31 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Sound)
32 bool bShowDebug = false;
34 USplineSoundComponent();
36 virtual
void BeginPlay() override;
37 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
41 class UAudioComponent* AudioComponent;
43 class USplineComponent* SplineComponent;
45 float FalloffSqured = 0.0f;
47 FVector GetSoundLocation(const AActor* const Listener) const;
49 void Optimize(const FVector& AudioComponentLocation, const AActor* const Listener);