diff --git a/Content/Legumix/Weapon/Revolver/BP_Revolver.uasset b/Content/Legumix/Weapon/Revolver/BP_Revolver.uasset index da32f8b..dbf1b72 100644 --- a/Content/Legumix/Weapon/Revolver/BP_Revolver.uasset +++ b/Content/Legumix/Weapon/Revolver/BP_Revolver.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b311039ec415fc1fed686dc4c322140bcb18698ee405d39a3b5fb704c56d8e29 -size 55276 +oid sha256:ac50c4513c07edf8b9f7490a085727d27d29c53d4323b87db88e256d5f8a5b07 +size 55477 diff --git a/Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset b/Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset index 7c15256..3c4b2bf 100644 --- a/Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset +++ b/Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:80ddf98507ff92c02e8ddaecd3eb5a44005b52e1301b06bfb2c92c1c2cca28dd -size 57029 +oid sha256:045c438a124e16846c0ae55f93855b2a95e60a7f571cb45ebcd92f266e951ba4 +size 57491 diff --git a/Content/Legumix/Weapon/WeaponSwitchPlaceholder.uasset b/Content/Legumix/Weapon/WeaponSwitchPlaceholder.uasset new file mode 100644 index 0000000..bf4e006 --- /dev/null +++ b/Content/Legumix/Weapon/WeaponSwitchPlaceholder.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2a914a72c13cdfbf14e2b9c847c35fcf8e066559637c2702d4d8c275556fe51 +size 87809 diff --git a/Source/LegumeMix/Private/Weapon/LMWeaponBase.cpp b/Source/LegumeMix/Private/Weapon/LMWeaponBase.cpp index f07d3ef..cb68920 100644 --- a/Source/LegumeMix/Private/Weapon/LMWeaponBase.cpp +++ b/Source/LegumeMix/Private/Weapon/LMWeaponBase.cpp @@ -40,6 +40,11 @@ void ALMWeaponBase::Setup(USkeletalMeshComponent* Mesh, AActor* CharOwner) Player = Cast(CharOwner); } +void ALMWeaponBase::OnEquip_Implementation() +{ + PlaySound(EquipSound); +} + bool ALMWeaponBase::Reload() { return DefaultReload(); diff --git a/Source/LegumeMix/Private/Weapon/LMWeaponManager.cpp b/Source/LegumeMix/Private/Weapon/LMWeaponManager.cpp index 20e6b96..cdb6c95 100644 --- a/Source/LegumeMix/Private/Weapon/LMWeaponManager.cpp +++ b/Source/LegumeMix/Private/Weapon/LMWeaponManager.cpp @@ -161,5 +161,7 @@ void ULMWeaponManager::SetWeapon(const int Index) GetCurrentWeapon()->SetActorHiddenInGame(true); CurrentWeaponIndex = Index; GetCurrentWeapon()->SetActorHiddenInGame(false); + + GetCurrentWeapon()->OnEquip(); } diff --git a/Source/LegumeMix/Public/Weapon/LMWeaponBase.h b/Source/LegumeMix/Public/Weapon/LMWeaponBase.h index ca0da1e..c363662 100644 --- a/Source/LegumeMix/Public/Weapon/LMWeaponBase.h +++ b/Source/LegumeMix/Public/Weapon/LMWeaponBase.h @@ -20,8 +20,12 @@ public: ALMWeaponBase(); virtual void BeginPlay() override; void Setup(USkeletalMeshComponent* Mesh, AActor* CharOwner); - + public: + UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category=Legumix) + void OnEquip(); + virtual void OnEquip_Implementation(); + UFUNCTION(BlueprintCallable) virtual bool Reload(); @@ -66,6 +70,9 @@ protected: /* Weapon Data */ UPROPERTY(EditAnywhere, BlueprintReadWrite,Category="Legumix|Sounds") TObjectPtr DryFireSound; + + UPROPERTY(EditAnywhere, BlueprintReadWrite,Category="Legumix|Sounds") + TObjectPtr EquipSound; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Legumix|Animations", meta=(AllowPrivateAccess=true)) TObjectPtr PrimaryFireAnimation;