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)
|
||||
{
|
||||
if (APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor))
|
||||
{
|
||||
{
|
||||
// TODO: Add extra functionality
|
||||
if (PickupSoundBase)
|
||||
{
|
||||
UGameplayStatics::PlaySound2D(GetWorld(), PickupSoundBase);
|
||||
}
|
||||
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@ public:
|
|||
|
||||
UPROPERTY(EditAnywhere)
|
||||
UPaperSpriteComponent* SpriteComponent = nullptr;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
USoundBase* PickupSoundBase = nullptr;
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
|
|
Loading…
Reference in New Issue