weapon setup
This commit is contained in:
@@ -8,6 +8,8 @@ AWeaponBase::AWeaponBase()
|
||||
{
|
||||
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
bReplicates = true;
|
||||
WeaponMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon Component"));
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +17,13 @@ AWeaponBase::AWeaponBase()
|
||||
void AWeaponBase::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
// AMMO_REPACK.AddDynamic(this, &AWeaponBase::MagRepacking);
|
||||
for (int i = 0; i < RESERVE_MAG_COUNT; i++)
|
||||
{
|
||||
// AMagazineActor* mag = new AMagazineActor();
|
||||
// mag->SetAmmoValues(MAX_AMMO_COUNT);
|
||||
// ActiveMags.Add(mag);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,3 +34,15 @@ void AWeaponBase::Tick(float DeltaTime)
|
||||
|
||||
}
|
||||
|
||||
void AWeaponBase::MagRepacking()
|
||||
{
|
||||
RESERVE_AMMO_POOL_DEFAULT -= 1;
|
||||
if (RESERVE_AMMO_POOL_DEFAULT <= 0)
|
||||
{
|
||||
RESERVE_AMMO_POOL_DEFAULT = 0;
|
||||
// for (AMagazineActor* mag : ActiveMags)
|
||||
// {
|
||||
// mag->hasReserveAmmo = false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user