Make FireWeaponAction a BlueprintNativeEvent
This commit is contained in:
parent
26edffa233
commit
7102040635
|
@ -25,8 +25,9 @@ void AWeapon::BeginPlay()
|
|||
}
|
||||
}
|
||||
|
||||
void AWeapon::FireWeaponAction()
|
||||
void AWeapon::FireWeaponAction_Implementation()
|
||||
{
|
||||
// Do stuff
|
||||
}
|
||||
|
||||
void AWeapon::UpgradeWeapon(int newLevel)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -18,7 +18,7 @@ void AGarlicWeapon::BeginPlay()
|
|||
SphereComponent->OnComponentEndOverlap.AddDynamic(this, &AGarlicWeapon::OnEndOverlap);
|
||||
}
|
||||
|
||||
void AGarlicWeapon::FireWeaponAction()
|
||||
void AGarlicWeapon::FireWeaponAction_Implementation()
|
||||
{
|
||||
TArray<AEnemyCharacter*> OverlappedEnemiesCache = OverlappedEnemies;
|
||||
|
||||
|
@ -54,8 +54,6 @@ void AGarlicWeapon::FireWeaponAction()
|
|||
i -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Super::FireWeaponAction();
|
||||
}
|
||||
|
||||
void AGarlicWeapon::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
||||
|
|
|
@ -27,7 +27,7 @@ protected:
|
|||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
virtual void FireWeaponAction() override;
|
||||
virtual void FireWeaponAction_Implementation() override;
|
||||
|
||||
protected:
|
||||
UFUNCTION()
|
||||
|
|
Loading…
Reference in New Issue