[UPD] Add player HealthComponent and hitboxes

This commit is contained in:
Emilie Schott 2025-03-03 00:13:53 +01:00
parent 2790a0eb40
commit 838fa55cc5
3 changed files with 10 additions and 3 deletions

BIN
Content/Legumix/Player/BP_Play.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -9,6 +9,7 @@
#include "Camera/CameraComponent.h"
#include "Ammo/LMAmmo.h"
#include "Player/LMBulletInfo.h"
#include "Player/LMHealthComponent.h"
#include "Player/LMHitBox.h"
#include "Weapon/LMWeaponManager.h"
@ -25,6 +26,7 @@ ALMPlayer::ALMPlayer()
// ArmsMesh->SetupAttachment(Camera);
SpreadStream = FRandomStream(FMath::Rand());
HealthComponent = CreateDefaultSubobject<ULMHealthComponent>(TEXT("HealthComponent"));
}
void ALMPlayer::BeginPlay()
@ -34,6 +36,8 @@ void ALMPlayer::BeginPlay()
WeaponManager->WeaponSwitched.AddUniqueDynamic(this, &ALMPlayer::WeaponSwitched);
GetCamera()->SetFieldOfView(ULMUserSettings::GetLegumixUserSettings()->FieldOfView);
}
bool ALMPlayer::PickUpAmmo(ALMAmmo* Ammo)

View File

@ -10,7 +10,7 @@
class UCameraComponent;
class ULMWeaponManager;
class ULMHealthComponent;
class ALMAmmo;
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnRequestUnpauseSignature);
@ -110,6 +110,9 @@ private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<UCameraComponent> Camera;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<ULMHealthComponent> HealthComponent;
private:
#if WITH_EDITORONLY_DATA
/** If set, bullet debug will be drawn. */