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. }
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(); } } }