--------------------------------------------------------------------------------------------------------------------------
| 61 | |
| 62 | //-------------------------------------------------------------------------------------------------------------------------- |
| 63 | void UCogSampleAreaComponent::BeginPlay() |
| 64 | { |
| 65 | COG_LOG_OBJECT(LogCogArea, ELogVerbosity::Verbose, GetOwner()->GetInstigator(), TEXT("Area:%s"), *GetName()); |
| 66 | |
| 67 | IsAtStart = true; |
| 68 | IsAtEnd = false; |
| 69 | |
| 70 | if (GetOwner()->HasAuthority()) |
| 71 | { |
| 72 | if (TickRate > 0.0f && DurationType != ECogSampleAreaDurationType::Instant) |
| 73 | { |
| 74 | GetWorld()->GetTimerManager().SetTimer(TickTimerHandle, this, &UCogSampleAreaComponent::OnTickEffect, TickRate, true, InitialTickDelay); |
| 75 | } |
| 76 | |
| 77 | if (DurationType == ECogSampleAreaDurationType::HasDuration) |
| 78 | { |
| 79 | GetWorld()->GetTimerManager().SetTimer(DurationTimerHandle, this, &UCogSampleAreaComponent::OnDurationElapsed, Duration, false); |
| 80 | } |
| 81 | |
| 82 | RegisterAllEffects(); |
| 83 | |
| 84 | GetOwner()->OnActorBeginOverlap.AddDynamic(this, &UCogSampleAreaComponent::OnActorEntered); |
| 85 | GetOwner()->OnActorEndOverlap.AddDynamic(this, &UCogSampleAreaComponent::OnActorExited); |
| 86 | |
| 87 | |
| 88 | } |
| 89 | |
| 90 | Super::BeginPlay(); |
| 91 | } |
| 92 | |
| 93 | //-------------------------------------------------------------------------------------------------------------------------- |
| 94 | void UCogSampleAreaComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) |
nothing calls this directly
no test coverage detected