Exemple #1
0
void URPGEffectBase::Tick( float DeltaTime)
{
	//Super::Tick(DeltaTime);
	if(!AffectedTarget)
		return;
	if(!GetWorld())
		return;
	if(!IsEffectActive)
		return;

	currentTickTime += DeltaTime;
	if(currentTickTime >= TickDuration)
	{
		if(GetWorld())
		{
			OnEffectTick();
		}
		currentTickTime = 0;
	}
	currentDuration += DeltaTime;
	if(currentDuration >= Duration)
	{
		currentDuration = 0;
		OnEffectEnd();
		AffectedTarget->EffectManager->RemoveEffect(this);
	}
	OnEffectTickFrame(); //this will tick every frame.
	SetAttributeUpdates();
}
void URPGEffectPeriodic::Tick(float DeltaTime)
{
	currentPeriodTime += DeltaTime;
	if (currentPeriodTime >= PeriodLenght)
	{
		OnEffectPeriodHit.Broadcast();
		OnEffectPeriod();
		currentPeriodTime = 0;
	}
	//if (ApplicationType != EApplicationType::Infinite)
	//{
	CurrentDuration += DeltaTime;
	if (CurrentDuration >= TotalDuration)
	{
		CurrentDuration = 0;
		SelfRemoveEffect();
	}
	//}
	OnEffectTick(); //this will tick every frame.
}