25 lines
484 B
C++
25 lines
484 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "HealthPickup.h"
|
|
|
|
#include "Blaster/Character/BlasterCharacter.h"
|
|
#include "Blaster/Components/BuffComponent.h"
|
|
|
|
AHealthPickup::AHealthPickup()
|
|
{
|
|
bReplicates = true;
|
|
}
|
|
|
|
void AHealthPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
|
|
{
|
|
Super::OnOverlap(BlasterCharacter);
|
|
|
|
if (UBuffComponent* Buff = BlasterCharacter->GetBuff())
|
|
{
|
|
Buff->Heal(HealAmount, HealingTime);
|
|
}
|
|
|
|
Destroy();
|
|
}
|