Пример #1
0
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.
}
Пример #2
0
void AAREffectPeriodic::TickMe(float DeltaTime)
{
	if (IsEffectActive)
	{
		CurrentDuration += DeltaTime;
		CurrentPeriodDuration += DeltaTime;
		if (CurrentPeriodDuration >= PeriodDuration)
		{
			CurrentPeriodDuration = 0;
			OnEffectInterval.Broadcast();
			OnEffectPeriod();
		}
		if (CurrentDuration >= MaxDuration)
		{
			CurrentDuration = 0;
			IsEffectActive = false;
			OnEffectRemoved.Broadcast();
			Deactivate();
		}
	}
}