From b0c46c615b3bc2001baec1047a6c81542d379e1b Mon Sep 17 00:00:00 2001 From: baz Date: Sun, 25 Aug 2024 03:42:55 +0100 Subject: [PATCH] Add Sound Effects to pickups --- Content/Pickups/EXP/BP_BlueEXPPickup.uasset | 4 ++-- Content/Pickups/EXP/BP_GreenEXPPickup.uasset | 4 ++-- Content/Pickups/EXP/BP_RedEXPPickup.uasset | 4 ++-- Content/Pickups/Gold/BP_GoldPickup.uasset | 4 ++-- Content/Sounds/coin-collection-2.uasset | 3 +++ Content/Sounds/coin-collection-2_Cue.uasset | 3 +++ Content/Sounds/coin-collection.uasset | 3 +++ Content/Sounds/coin-collection_Cue.uasset | 3 +++ Source/vampires/Pickup.cpp | 7 ++++++- Source/vampires/Pickup.h | 3 +++ 10 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 Content/Sounds/coin-collection-2.uasset create mode 100644 Content/Sounds/coin-collection-2_Cue.uasset create mode 100644 Content/Sounds/coin-collection.uasset create mode 100644 Content/Sounds/coin-collection_Cue.uasset diff --git a/Content/Pickups/EXP/BP_BlueEXPPickup.uasset b/Content/Pickups/EXP/BP_BlueEXPPickup.uasset index c5db3a6..5d5b6c0 100644 --- a/Content/Pickups/EXP/BP_BlueEXPPickup.uasset +++ b/Content/Pickups/EXP/BP_BlueEXPPickup.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:021fefd2ada7549a36d4ba8730a10972ed95547ac7a042197b086112d3167099 -size 24149 +oid sha256:bdd56ecc52e1743a5fb15cce620b932d1506d297aa4757d9e8d1ebe126dafdd4 +size 24365 diff --git a/Content/Pickups/EXP/BP_GreenEXPPickup.uasset b/Content/Pickups/EXP/BP_GreenEXPPickup.uasset index d7760c9..63c31cc 100644 --- a/Content/Pickups/EXP/BP_GreenEXPPickup.uasset +++ b/Content/Pickups/EXP/BP_GreenEXPPickup.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:943428e36aa714badf946c93eff244a1ea22479fb65d14e7a60ceb1a28727861 -size 24049 +oid sha256:a8a5940d909f9d7c89f30b2130a7f807b1bb60e68dc2f1c9a97e2399437c7c27 +size 24265 diff --git a/Content/Pickups/EXP/BP_RedEXPPickup.uasset b/Content/Pickups/EXP/BP_RedEXPPickup.uasset index 7ad4248..3215288 100644 --- a/Content/Pickups/EXP/BP_RedEXPPickup.uasset +++ b/Content/Pickups/EXP/BP_RedEXPPickup.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b278957d46244c75be688f72db4c62aa3177b6e151e5133adb7cb0f739b0a318 -size 24007 +oid sha256:cac58b08cf6ccd71d8173da2c6e2c10ee357fa48aa4daf9737743d2b8829a92f +size 24223 diff --git a/Content/Pickups/Gold/BP_GoldPickup.uasset b/Content/Pickups/Gold/BP_GoldPickup.uasset index 592bb9d..b185c30 100644 --- a/Content/Pickups/Gold/BP_GoldPickup.uasset +++ b/Content/Pickups/Gold/BP_GoldPickup.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3886ef134926b3adeb5ffe3230bd1af08a629de7154697eb148e597be6242ca -size 25864 +oid sha256:2d35028ee621f020df40b6b0222b5f0f8b7c3105514ebd4d1e5a495feb851407 +size 26076 diff --git a/Content/Sounds/coin-collection-2.uasset b/Content/Sounds/coin-collection-2.uasset new file mode 100644 index 0000000..86eb4af --- /dev/null +++ b/Content/Sounds/coin-collection-2.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd07b67615c0568a7e88febc174840b25287f1cb40fbed75f83788d0ddadc712 +size 9498 diff --git a/Content/Sounds/coin-collection-2_Cue.uasset b/Content/Sounds/coin-collection-2_Cue.uasset new file mode 100644 index 0000000..195cd0d --- /dev/null +++ b/Content/Sounds/coin-collection-2_Cue.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:537aea843b4c14eb6c5a33e4881df286d19767882c0ac5a67f75bed7bdb389e1 +size 4292 diff --git a/Content/Sounds/coin-collection.uasset b/Content/Sounds/coin-collection.uasset new file mode 100644 index 0000000..955a65b --- /dev/null +++ b/Content/Sounds/coin-collection.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da890fad5ea78cd99a1652b973dfbda3b62890ff48534daf662a84e8095dec5a +size 8915 diff --git a/Content/Sounds/coin-collection_Cue.uasset b/Content/Sounds/coin-collection_Cue.uasset new file mode 100644 index 0000000..80549be --- /dev/null +++ b/Content/Sounds/coin-collection_Cue.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5ed8a42f7ac08008f95d5886f898c75eeb58a24f48715fd566b89257bf1b140 +size 4278 diff --git a/Source/vampires/Pickup.cpp b/Source/vampires/Pickup.cpp index e25b655..328d457 100644 --- a/Source/vampires/Pickup.cpp +++ b/Source/vampires/Pickup.cpp @@ -53,8 +53,13 @@ void APickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* O const FHitResult& SweepResult) { if (APlayerCharacter* PlayerCharacter = Cast(OtherActor)) - { + { // TODO: Add extra functionality + if (PickupSoundBase) + { + UGameplayStatics::PlaySound2D(GetWorld(), PickupSoundBase); + } + Destroy(); } } diff --git a/Source/vampires/Pickup.h b/Source/vampires/Pickup.h index 8187212..97dfffe 100644 --- a/Source/vampires/Pickup.h +++ b/Source/vampires/Pickup.h @@ -26,6 +26,9 @@ public: UPROPERTY(EditAnywhere) UPaperSpriteComponent* SpriteComponent = nullptr; + + UPROPERTY(EditDefaultsOnly) + USoundBase* PickupSoundBase = nullptr; public: // Sets default values for this actor's properties