blaster/Source/Blaster/Pickups/SpeedPickup.cpp

20 lines
453 B
C++
Raw Normal View History

2022-05-22 23:06:42 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "SpeedPickup.h"
#include "Blaster/Character/BlasterCharacter.h"
#include "Blaster/Components/BuffComponent.h"
2022-05-23 21:45:28 +00:00
void ASpeedPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
2022-05-22 23:06:42 +00:00
{
2022-05-23 21:45:28 +00:00
Super::OnOverlap(BlasterCharacter);
2022-05-22 23:06:42 +00:00
2022-05-23 21:45:28 +00:00
if (UBuffComponent* Buff = BlasterCharacter->GetBuff())
2022-05-22 23:06:42 +00:00
{
2022-05-23 21:45:28 +00:00
Buff->BuffSpeed(BaseSpeedBuff, CrouchSpeedBuff, SpeedBuffTime);
2022-05-22 23:06:42 +00:00
}
2022-05-23 21:45:28 +00:00
2022-05-22 23:06:42 +00:00
Destroy();
}