Add Sound Effects to pickups
This commit is contained in:
parent
3382a62b71
commit
b0c46c615b
BIN
Content/Pickups/EXP/BP_BlueEXPPickup.uasset (Stored with Git LFS)
BIN
Content/Pickups/EXP/BP_BlueEXPPickup.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Pickups/EXP/BP_GreenEXPPickup.uasset (Stored with Git LFS)
BIN
Content/Pickups/EXP/BP_GreenEXPPickup.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Pickups/EXP/BP_RedEXPPickup.uasset (Stored with Git LFS)
BIN
Content/Pickups/EXP/BP_RedEXPPickup.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/Pickups/Gold/BP_GoldPickup.uasset (Stored with Git LFS)
BIN
Content/Pickups/Gold/BP_GoldPickup.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -53,8 +53,13 @@ void APickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* O
|
||||||
const FHitResult& SweepResult)
|
const FHitResult& SweepResult)
|
||||||
{
|
{
|
||||||
if (APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor))
|
if (APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor))
|
||||||
{
|
{
|
||||||
// TODO: Add extra functionality
|
// TODO: Add extra functionality
|
||||||
|
if (PickupSoundBase)
|
||||||
|
{
|
||||||
|
UGameplayStatics::PlaySound2D(GetWorld(), PickupSoundBase);
|
||||||
|
}
|
||||||
|
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,9 @@ public:
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
UPaperSpriteComponent* SpriteComponent = nullptr;
|
UPaperSpriteComponent* SpriteComponent = nullptr;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
USoundBase* PickupSoundBase = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Sets default values for this actor's properties
|
// Sets default values for this actor's properties
|
||||||
|
|
Loading…
Reference in New Issue