diff --git a/Source/vampires/Weapon.cpp b/Source/vampires/Weapon.cpp index 986624f..9302413 100644 --- a/Source/vampires/Weapon.cpp +++ b/Source/vampires/Weapon.cpp @@ -25,8 +25,9 @@ void AWeapon::BeginPlay() } } -void AWeapon::FireWeaponAction() +void AWeapon::FireWeaponAction_Implementation() { + // Do stuff } void AWeapon::UpgradeWeapon(int newLevel) diff --git a/Source/vampires/Weapon.h b/Source/vampires/Weapon.h index c19927a..43e2a2c 100644 --- a/Source/vampires/Weapon.h +++ b/Source/vampires/Weapon.h @@ -12,10 +12,10 @@ class VAMPIRES_API AWeapon : public AActor GENERATED_BODY() public: - UPROPERTY() + UPROPERTY(BlueprintReadWrite) float WeaponCooldown = 1.0f; - UPROPERTY() + UPROPERTY(BlueprintReadWrite) float Damage; private: @@ -30,8 +30,10 @@ protected: virtual void BeginPlay() override; public: - UFUNCTION(BlueprintCallable) - virtual void FireWeaponAction(); + + UFUNCTION(BlueprintNativeEvent) + void FireWeaponAction(); + virtual void FireWeaponAction_Implementation(); UFUNCTION() virtual void UpgradeWeapon(int newLevel); diff --git a/Source/vampires/Weapons/GarlicWeapon.cpp b/Source/vampires/Weapons/GarlicWeapon.cpp index 64bf876..4aff802 100644 --- a/Source/vampires/Weapons/GarlicWeapon.cpp +++ b/Source/vampires/Weapons/GarlicWeapon.cpp @@ -18,7 +18,7 @@ void AGarlicWeapon::BeginPlay() SphereComponent->OnComponentEndOverlap.AddDynamic(this, &AGarlicWeapon::OnEndOverlap); } -void AGarlicWeapon::FireWeaponAction() +void AGarlicWeapon::FireWeaponAction_Implementation() { TArray OverlappedEnemiesCache = OverlappedEnemies; @@ -54,8 +54,6 @@ void AGarlicWeapon::FireWeaponAction() i -= 1; } } - - Super::FireWeaponAction(); } void AGarlicWeapon::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, diff --git a/Source/vampires/Weapons/GarlicWeapon.h b/Source/vampires/Weapons/GarlicWeapon.h index 9b3f2ff..4e9f0ca 100644 --- a/Source/vampires/Weapons/GarlicWeapon.h +++ b/Source/vampires/Weapons/GarlicWeapon.h @@ -27,7 +27,7 @@ protected: virtual void BeginPlay() override; public: - virtual void FireWeaponAction() override; + virtual void FireWeaponAction_Implementation() override; protected: UFUNCTION()