blaster/Source/Blaster/Pickups/ShieldPickup.cpp

20 lines
457 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "ShieldPickup.h"
#include "Blaster/Character/BlasterCharacter.h"
#include "Blaster/Components/BuffComponent.h"
void AShieldPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
{
Super::OnOverlap(BlasterCharacter);
if (UBuffComponent* Buff = BlasterCharacter->GetBuff())
{
Buff->ReplenishShield(ShieldReplenishAmount, ShieldReplenishTime);
}
Destroy();
}