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)
|
void AWeapon::UpgradeWeapon(int newLevel)
|
||||||
|
|
|
@ -12,10 +12,10 @@ class VAMPIRES_API AWeapon : public AActor
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY()
|
UPROPERTY(BlueprintReadWrite)
|
||||||
float WeaponCooldown = 1.0f;
|
float WeaponCooldown = 1.0f;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY(BlueprintReadWrite)
|
||||||
float Damage;
|
float Damage;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -30,8 +30,10 @@ protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
virtual void FireWeaponAction();
|
UFUNCTION(BlueprintNativeEvent)
|
||||||
|
void FireWeaponAction();
|
||||||
|
virtual void FireWeaponAction_Implementation();
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
virtual void UpgradeWeapon(int newLevel);
|
virtual void UpgradeWeapon(int newLevel);
|
||||||
|
|
|
@ -18,7 +18,7 @@ void AGarlicWeapon::BeginPlay()
|
||||||
SphereComponent->OnComponentEndOverlap.AddDynamic(this, &AGarlicWeapon::OnEndOverlap);
|
SphereComponent->OnComponentEndOverlap.AddDynamic(this, &AGarlicWeapon::OnEndOverlap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGarlicWeapon::FireWeaponAction()
|
void AGarlicWeapon::FireWeaponAction_Implementation()
|
||||||
{
|
{
|
||||||
TArray<AEnemyCharacter*> OverlappedEnemiesCache = OverlappedEnemies;
|
TArray<AEnemyCharacter*> OverlappedEnemiesCache = OverlappedEnemies;
|
||||||
|
|
||||||
|
@ -54,8 +54,6 @@ void AGarlicWeapon::FireWeaponAction()
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Super::FireWeaponAction();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGarlicWeapon::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
void AGarlicWeapon::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
|
||||||
|
|
|
@ -27,7 +27,7 @@ protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void FireWeaponAction() override;
|
virtual void FireWeaponAction_Implementation() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
|
|
Loading…
Reference in New Issue