Merge
This commit is contained in:
commit
1a0af4e131
BIN
Content/Audio/BlueMann/Audio_Track-10.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-10.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-2.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-2.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-3.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-3.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-4.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-4.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-5.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-5.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-6.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-6.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-7.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-7.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-8.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-8.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track-9.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track-9.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/Audio_Track.uasset
Normal file
BIN
Content/Audio/BlueMann/Audio_Track.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/BlueMann/BlueManCue.uasset
Normal file
BIN
Content/Audio/BlueMann/BlueManCue.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Cue.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Cue.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L1.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L1.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L2.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L2.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L3.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L3.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L4.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L4.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L5.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L5.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L6.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L6.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L7.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L7.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L9.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMI-L9.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMi-L8.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Leicht/GMi-L8.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M1.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M1.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M2.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M2.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M3.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M3.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M4.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M4.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M5.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M5.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M6.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M6.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M7.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Mittel/GMI-M7.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S1.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S1.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S2.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S2.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S3.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S3.uasset
Normal file
Binary file not shown.
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S4.uasset
Normal file
BIN
Content/Audio/GelbMannImpact/GMI-Schwer/GMI-S4.uasset
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/Audio/Sound/345684__provan9__radio-alert.uasset
Normal file
BIN
Content/Audio/Sound/345684__provan9__radio-alert.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,7 +2,8 @@
|
||||
|
||||
#include "Components/AudioComponent.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
|
||||
#include "Engine/World.h"
|
||||
#include "Engine/Public/TimerManager.h"
|
||||
|
||||
URotatingActor::URotatingActor()
|
||||
{
|
||||
@ -34,35 +35,17 @@ void URotatingActor::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
|
||||
|
||||
void URotatingActor::Rotate(const FRotator TargetRotation)
|
||||
{
|
||||
this->targetRotation = TargetRotation;
|
||||
rotating = true;
|
||||
tempRotation = (TargetRotation.Yaw < 0) ? -1.f : 1.f;
|
||||
if (Negative)
|
||||
FTimerHandle handle;
|
||||
|
||||
if(RotationDelay == 0)
|
||||
{
|
||||
tempRotation = (TargetRotation.Yaw < 0) ? 1.f : -1.f;
|
||||
}
|
||||
|
||||
TArray<UAudioComponent*> Audios;
|
||||
GetOwner()->GetComponents<UAudioComponent>(Audios);
|
||||
|
||||
if (Audios.Num() == 0) return;
|
||||
if (soundHasBeenPlayed) return;
|
||||
|
||||
for (auto Audio : Audios)
|
||||
Move(targetRotation);
|
||||
}else
|
||||
{
|
||||
if (Audio->ComponentHasTag("location"))
|
||||
{
|
||||
UGameplayStatics::PlaySoundAtLocation(GetOwner(), Audio->Sound, GetOwner()->GetActorLocation(),
|
||||
GetOwner()->GetActorRotation(), 1, 1, 0,
|
||||
Audio->AttenuationSettings, nullptr, GetOwner());
|
||||
}
|
||||
else
|
||||
{
|
||||
Audio->Play();
|
||||
}
|
||||
}
|
||||
|
||||
soundHasBeenPlayed = true;
|
||||
GetWorld()->GetTimerManager().SetTimer(handle, [this, TargetRotation]() {
|
||||
Move(TargetRotation);
|
||||
}, RotationDelay, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void URotatingActor::Rotate()
|
||||
@ -70,4 +53,37 @@ void URotatingActor::Rotate()
|
||||
FRotator rotation = GetOwner()->GetActorRotation();
|
||||
rotation.Yaw = TargetAngle;
|
||||
Rotate(rotation);
|
||||
}
|
||||
}
|
||||
|
||||
void URotatingActor::Move(const FRotator TargetRotation)
|
||||
{
|
||||
this->targetRotation = TargetRotation;
|
||||
rotating = true;
|
||||
tempRotation = (TargetRotation.Yaw < 0) ? -1.f : 1.f;
|
||||
if (Negative)
|
||||
{
|
||||
tempRotation = (TargetRotation.Yaw < 0) ? 1.f : -1.f;
|
||||
}
|
||||
|
||||
TArray<UAudioComponent*> Audios;
|
||||
GetOwner()->GetComponents<UAudioComponent>(Audios);
|
||||
|
||||
if (Audios.Num() == 0) return;
|
||||
if (soundHasBeenPlayed) return;
|
||||
|
||||
for (auto Audio : Audios)
|
||||
{
|
||||
if (Audio->ComponentHasTag("location"))
|
||||
{
|
||||
UGameplayStatics::PlaySoundAtLocation(GetOwner(), Audio->Sound, GetOwner()->GetActorLocation(),
|
||||
GetOwner()->GetActorRotation(), 1, 1, 0,
|
||||
Audio->AttenuationSettings, nullptr, GetOwner());
|
||||
}
|
||||
else
|
||||
{
|
||||
Audio->Play();
|
||||
}
|
||||
}
|
||||
|
||||
soundHasBeenPlayed = true;
|
||||
}
|
@ -34,7 +34,7 @@ public:
|
||||
float RotationSpeed = 15.f;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
float RotationDelay = 2.f;
|
||||
float RotationDelay = 0.f;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
bool Negative = false;
|
||||
@ -44,4 +44,5 @@ private:
|
||||
bool rotating;
|
||||
bool soundHasBeenPlayed;
|
||||
float tempRotation;
|
||||
void Move(FRotator TargetRotation);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user