Compare commits

..

No commits in common. "cafb8206e5beed6adfedee024344335b5289a596" and "e8d7c49a4e29d846443c49d0a90fa5ab84d9063f" have entirely different histories.

6 changed files with 9 additions and 41 deletions

View File

@ -3,8 +3,6 @@
#include "EXPPickup.h" #include "EXPPickup.h"
#include "PlayerCharacter.h"
void AEXPPickup::BeginPlay() void AEXPPickup::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@ -18,9 +16,7 @@ void AEXPPickup::Tick(float DeltaSeconds)
void AEXPPickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, void AEXPPickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{ {
if (APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor)) // TODO: Add EXP to player EXP component
{
PlayerCharacter->GetEXPComponent()->IncrementEXP(EXP);
Super::OnBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult); Super::OnBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
} }
}

View File

@ -14,9 +14,6 @@ class VAMPIRES_API AEXPPickup : public APickup
{ {
GENERATED_BODY() GENERATED_BODY()
public:
int EXP = 1;
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@ -3,10 +3,6 @@
#include "GoldPickup.h" #include "GoldPickup.h"
#include "PlayerCharacter.h"
class APlayerCharacter;
void AGoldPickup::BeginPlay() void AGoldPickup::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@ -20,9 +16,7 @@ void AGoldPickup::Tick(float DeltaSeconds)
void AGoldPickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, void AGoldPickup::OnBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{ {
if (APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(OtherActor)) // TODO: Add Gold to player Gold component
{
PlayerCharacter->GetGoldComponent()->IncrementGold(Gold);
Super::OnBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult); Super::OnBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult);
} }
}

View File

@ -14,11 +14,6 @@ class VAMPIRES_API AGoldPickup : public APickup
{ {
GENERATED_BODY() GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
int Gold = 1;
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@ -74,16 +74,6 @@ void APlayerCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCom
} }
} }
UEXPComponent* APlayerCharacter::GetEXPComponent()
{
return EXPComponent;
}
UGoldComponent* APlayerCharacter::GetGoldComponent()
{
return GoldComponent;
}
void APlayerCharacter::MovementCallback(const FInputActionInstance& Instance) void APlayerCharacter::MovementCallback(const FInputActionInstance& Instance)
{ {
FVector2D vec2 = Instance.GetValue().Get<FVector2D>(); FVector2D vec2 = Instance.GetValue().Get<FVector2D>();

View File

@ -67,10 +67,6 @@ protected:
public: public:
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
UEXPComponent* GetEXPComponent();
UGoldComponent* GetGoldComponent();
private: private:
UFUNCTION() UFUNCTION()
void MovementCallback(const FInputActionInstance& Instance); void MovementCallback(const FInputActionInstance& Instance);