2025-03-15 13:48:39 +01:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "Items/GunBase.h"
|
|
|
|
|
|
2025-03-15 23:34:17 +01:00
|
|
|
#include "Characters/Components/ShootingComponent.h"
|
|
|
|
|
|
2025-03-15 13:48:39 +01:00
|
|
|
// Sets default values
|
|
|
|
|
AGunBase::AGunBase()
|
|
|
|
|
{
|
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Called when the game starts or when spawned
|
|
|
|
|
void AGunBase::BeginPlay()
|
|
|
|
|
{
|
|
|
|
|
Super::BeginPlay();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Called every frame
|
|
|
|
|
void AGunBase::Tick(float DeltaTime)
|
|
|
|
|
{
|
|
|
|
|
Super::Tick(DeltaTime);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-15 23:34:17 +01:00
|
|
|
void AGunBase::Interact_Implementation(AExoPlayerCharacter* playerCharacter)
|
|
|
|
|
{
|
|
|
|
|
playerCharacter->ShootingComponent->PickUpGun(this);
|
|
|
|
|
|
|
|
|
|
Destroy();
|
|
|
|
|
}
|