Move WeaponInventoryComponent to base character class
This commit is contained in:
parent
eae0dbb802
commit
dc5e4bb3a2
|
@ -39,9 +39,6 @@ APlayerCharacter::APlayerCharacter()
|
||||||
// Create Gold Component
|
// Create Gold Component
|
||||||
GoldComponent = CreateDefaultSubobject<UGoldComponent>(TEXT("Gold Component"));
|
GoldComponent = CreateDefaultSubobject<UGoldComponent>(TEXT("Gold Component"));
|
||||||
|
|
||||||
//Create Weapon Inventory Component
|
|
||||||
WeaponInventoryComponent = CreateDefaultSubobject<UWeaponInventoryComponent>(TEXT("Weapon Inventory Component"));
|
|
||||||
|
|
||||||
// Create HealthBar Widget Component
|
// Create HealthBar Widget Component
|
||||||
HealthBarWidgetComponent = CreateDefaultSubobject<UWidgetComponent>(TEXT("Healthbar"));
|
HealthBarWidgetComponent = CreateDefaultSubobject<UWidgetComponent>(TEXT("Healthbar"));
|
||||||
HealthBarWidgetComponent->SetupAttachment(RootComponent);
|
HealthBarWidgetComponent->SetupAttachment(RootComponent);
|
||||||
|
|
|
@ -37,9 +37,6 @@ public:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
UGoldComponent* GoldComponent;
|
UGoldComponent* GoldComponent;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
||||||
UWeaponInventoryComponent* WeaponInventoryComponent;
|
|
||||||
|
|
||||||
FVector2D PreviousMovementDirection = FVector2d(1.0f, 0.0f);
|
FVector2D PreviousMovementDirection = FVector2d(1.0f, 0.0f);
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include "HealthComponent.h"
|
#include "HealthComponent.h"
|
||||||
#include "PaperFlipbookComponent.h"
|
#include "PaperFlipbookComponent.h"
|
||||||
|
#include "WeaponInventoryComponent.h"
|
||||||
|
|
||||||
// Sets default values
|
// Sets default values
|
||||||
AVampireCharacter::AVampireCharacter()
|
AVampireCharacter::AVampireCharacter()
|
||||||
|
@ -19,6 +20,9 @@ AVampireCharacter::AVampireCharacter()
|
||||||
PaperFlipbookComponent->SetRelativeRotation(FRotator(0.0f, 90.0f,-90.0f));
|
PaperFlipbookComponent->SetRelativeRotation(FRotator(0.0f, 90.0f,-90.0f));
|
||||||
PaperFlipbookComponent->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f));
|
PaperFlipbookComponent->SetRelativeScale3D(FVector(0.2f, 0.2f, 0.2f));
|
||||||
PaperFlipbookComponent->SetupAttachment(RootComponent);
|
PaperFlipbookComponent->SetupAttachment(RootComponent);
|
||||||
|
|
||||||
|
//Create Weapon Inventory Component
|
||||||
|
WeaponInventoryComponent = CreateDefaultSubobject<UWeaponInventoryComponent>(TEXT("Weapon Inventory Component"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "VampireCharacter.generated.h"
|
#include "VampireCharacter.generated.h"
|
||||||
|
|
||||||
|
class UWeaponInventoryComponent;
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
class UHealthComponent;
|
class UHealthComponent;
|
||||||
class UPaperFlipbookComponent;
|
class UPaperFlipbookComponent;
|
||||||
|
@ -27,6 +28,9 @@ protected:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
TObjectPtr<UInputMappingContext> InputMappingContext;
|
TObjectPtr<UInputMappingContext> InputMappingContext;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UWeaponInventoryComponent* WeaponInventoryComponent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Sets default values for this character's properties
|
// Sets default values for this character's properties
|
||||||
AVampireCharacter();
|
AVampireCharacter();
|
||||||
|
|
Loading…
Reference in New Issue