MCPcopy Create free account
hub / github.com/arnaud-jamin/Cog / BeginPlay

Method BeginPlay

Source/CogSample/CogSampleAreaComponent.cpp:63–91  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

61
62//--------------------------------------------------------------------------------------------------------------------------
63void 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//--------------------------------------------------------------------------------------------------------------------------
94void UCogSampleAreaComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)

Callers

nothing calls this directly

Calls 3

GetOwnerFunction · 0.85
GetNameFunction · 0.85
GetInstigatorMethod · 0.80

Tested by

no test coverage detected