-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathN2C_EventStyleGuide.cpp
More file actions
30 lines (24 loc) · 923 Bytes
/
N2C_EventStyleGuide.cpp
File metadata and controls
30 lines (24 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Example file implementation: Reference context for Node to Code, not included in compilation
// Purpose: Demonstrate splitting Blueprint events into separate C++ methods
#include "N2C_EventStyleGuide.h"
// Override engine event BeginPlay, call Super::BeginPlay()
void AN2C_EventStyleGuideActor::BeginPlay()
{
Super::BeginPlay();
// Example logic: Trigger event dispatcher once
InternalCounter = 1;
OnSomethingHappened.Broadcast(InternalCounter);
}
// Override engine event Tick, call Super::Tick(DeltaTime)
void AN2C_EventStyleGuideActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
// Example logic: Increment counter
InternalCounter += 1;
}
// Custom event implementation, maintain one-to-one correspondence with Blueprint "Custom Event"
void AN2C_EventStyleGuideActor::MyCustomEvent()
{
// Example logic: Broadcast event
OnSomethingHappened.Broadcast(InternalCounter);
}