haxis/Source/UnrealProject/Abilities/BossTargetBunny.cpp

43 lines
626 B
C++

// Project Lab - NHTV Igad
#include "UnrealProject.h"
#include "BossTargetBunny.h"
ABossTargetBunny::ABossTargetBunny()
{
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
bReplicateMovement = true;
m_lifeTime = 0;
}
void ABossTargetBunny::BeginPlay()
{
Super::BeginPlay();
}
void ABossTargetBunny::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
// Server only
if (Role != ROLE_Authority)
return;
m_lifeTime -= DeltaTime;
if (m_lifeTime <= 0)
{
Destroy();
return;
}
}
void ABossTargetBunny::Setup(float lifeTime)
{
m_lifeTime = lifeTime;
}