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.
|
@ -55,6 +55,11 @@ void APickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* O
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,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
|
||||||
APickup();
|
APickup();
|
||||||
|
|
Loading…
Reference in New Issue