42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "StatusSystem.h"
|
|
#include <Runtime/Engine/Classes/Kismet/GameplayStatics.h>
|
|
|
|
// Sets default values for this component's properties
|
|
UStatusSystem::UStatusSystem()
|
|
{
|
|
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
|
|
// off to improve performance if you don't need them.
|
|
PrimaryComponentTick.bCanEverTick = true;
|
|
|
|
// ...
|
|
}
|
|
|
|
|
|
// Called when the game starts
|
|
void UStatusSystem::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
// ...
|
|
|
|
}
|
|
|
|
|
|
// Called every frame
|
|
void UStatusSystem::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
|
|
{
|
|
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
|
|
|
for (FActiveStatusEffect StatusEffect : ActiveStatusEffects)
|
|
{
|
|
if (StatusEffect.TimeTillExpiry > UGameplayStatics::GetRealTimeSeconds(GetWorld()))
|
|
{
|
|
//ActiveStatusEffects.RemoveAt(ActiveStatusEffects.Find(StatusEffect));
|
|
}
|
|
}
|
|
}
|
|
|