Added FirstPersonArm from Unreal FPS template. Modified ShootingComponent for using socket in character.
31 lines
471 B
C++
31 lines
471 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "Items/GunBase.h"
|
|
|
|
#include "Characters/Components/ShootingComponent.h"
|
|
|
|
AGunBase::AGunBase()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = true;
|
|
|
|
}
|
|
|
|
void AGunBase::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
}
|
|
|
|
void AGunBase::Tick(float DeltaTime)
|
|
{
|
|
Super::Tick(DeltaTime);
|
|
|
|
}
|
|
|
|
void AGunBase::AddAmmo(int AddValue)
|
|
{
|
|
CurrentAmmo += AddValue;
|
|
if (CurrentAmmo > MaxAmmo)
|
|
CurrentAmmo = MaxAmmo;
|
|
} |