claude-code-arcane 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +54 -6
- package/agents/game/ue-blueprint-specialist.md +125 -0
- package/agents/game/ue-gas-specialist.md +133 -0
- package/agents/game/ue-umg-specialist.md +131 -0
- package/dist/cli.js +5 -0
- package/docs/SKILLS-CATALOG.md +42 -3
- package/docs/USER-GUIDE.md +2 -2
- package/hooks/detect-unreal.sh +90 -0
- package/package.json +1 -1
- package/profiles/unreal-dev.yaml +97 -0
- package/rules/gamedev/unreal-code.md +125 -0
- package/skills/install-mcp/SKILL.md +135 -46
- package/skills/install-mcp/references/unreal-operations.md +55 -0
- package/skills/ue-actor-component-architecture/SKILL.md +509 -0
- package/skills/ue-actor-component-architecture/references/actor-lifecycle.md +301 -0
- package/skills/ue-actor-component-architecture/references/component-types.md +592 -0
- package/skills/ue-ai-navigation/SKILL.md +526 -0
- package/skills/ue-ai-navigation/references/behavior-tree-patterns.md +392 -0
- package/skills/ue-ai-navigation/references/behavior-tree-workflow.md +107 -0
- package/skills/ue-ai-navigation/references/custom-bttask.md +104 -0
- package/skills/ue-ai-navigation/references/eqs-reference.md +423 -0
- package/skills/ue-animation-system/SKILL.md +521 -0
- package/skills/ue-animation-system/references/anim-notify-reference.md +486 -0
- package/skills/ue-animation-system/references/locomotion-setup.md +550 -0
- package/skills/ue-async-threading/SKILL.md +433 -0
- package/skills/ue-async-threading/references/thread-safety-guide.md +213 -0
- package/skills/ue-async-threading/references/threading-patterns.md +345 -0
- package/skills/ue-audio-system/SKILL.md +527 -0
- package/skills/ue-audio-system/references/audio-setup-patterns.md +700 -0
- package/skills/ue-blueprints/SKILL.md +134 -0
- package/skills/ue-blueprints/references/communication.md +82 -0
- package/skills/ue-character-movement/SKILL.md +475 -0
- package/skills/ue-character-movement/references/cmc-extension-patterns.md +335 -0
- package/skills/ue-character-movement/references/movement-pipeline.md +189 -0
- package/skills/ue-cpp-foundations/SKILL.md +533 -0
- package/skills/ue-cpp-foundations/references/components-and-gc.md +107 -0
- package/skills/ue-cpp-foundations/references/container-patterns.md +544 -0
- package/skills/ue-cpp-foundations/references/delegate-patterns.md +497 -0
- package/skills/ue-cpp-foundations/references/gameplay-classes-cpp.md +136 -0
- package/skills/ue-cpp-foundations/references/property-specifiers.md +306 -0
- package/skills/ue-data-assets-tables/SKILL.md +527 -0
- package/skills/ue-data-assets-tables/references/asset-loading-patterns.md +306 -0
- package/skills/ue-data-assets-tables/references/data-driven-design.md +378 -0
- package/skills/ue-editor-tools/SKILL.md +523 -0
- package/skills/ue-editor-tools/references/detail-customization-patterns.md +395 -0
- package/skills/ue-editor-tools/references/editor-module-setup.md +480 -0
- package/skills/ue-game-features/SKILL.md +477 -0
- package/skills/ue-game-features/references/experience-system.md +222 -0
- package/skills/ue-game-features/references/game-feature-patterns.md +308 -0
- package/skills/ue-gameplay-abilities/SKILL.md +518 -0
- package/skills/ue-gameplay-abilities/references/ability-task-reference.md +391 -0
- package/skills/ue-gameplay-abilities/references/gameplay-effect-reference.md +397 -0
- package/skills/ue-gameplay-abilities/references/gas-setup-patterns.md +369 -0
- package/skills/ue-gameplay-framework/SKILL.md +466 -0
- package/skills/ue-gameplay-framework/references/framework-class-map.md +243 -0
- package/skills/ue-input-system/SKILL.md +394 -0
- package/skills/ue-input-system/references/cpp-setup.md +131 -0
- package/skills/ue-input-system/references/enhanced-input-workflow.md +117 -0
- package/skills/ue-input-system/references/input-action-reference.md +731 -0
- package/skills/ue-mass-entity/SKILL.md +476 -0
- package/skills/ue-mass-entity/references/mass-entity-patterns.md +319 -0
- package/skills/ue-mass-entity/references/mass-fragment-reference.md +119 -0
- package/skills/ue-materials-rendering/SKILL.md +526 -0
- package/skills/ue-materials-rendering/references/material-parameter-reference.md +216 -0
- package/skills/ue-materials-rendering/references/post-process-settings.md +383 -0
- package/skills/ue-module-build-system/SKILL.md +487 -0
- package/skills/ue-module-build-system/references/build-cs-reference.md +418 -0
- package/skills/ue-module-build-system/references/common-build-errors.md +381 -0
- package/skills/ue-naming-conventions/SKILL.md +142 -0
- package/skills/ue-naming-conventions/references/asset-name-modifiers.md +233 -0
- package/skills/ue-naming-conventions/references/content-structure.md +83 -0
- package/skills/ue-networking-replication/SKILL.md +452 -0
- package/skills/ue-networking-replication/references/replication-patterns.md +526 -0
- package/skills/ue-networking-replication/references/rpc-decision-guide.md +393 -0
- package/skills/ue-niagara-effects/SKILL.md +531 -0
- package/skills/ue-niagara-effects/references/niagara-data-interfaces.md +491 -0
- package/skills/ue-niagara-effects/references/niagara-parameter-types.md +153 -0
- package/skills/ue-niagara-effects/references/niagara-workflow.md +115 -0
- package/skills/ue-packaging/SKILL.md +116 -0
- package/skills/ue-physics-collision/SKILL.md +423 -0
- package/skills/ue-physics-collision/references/collision-channel-setup.md +218 -0
- package/skills/ue-physics-collision/references/trace-patterns.md +499 -0
- package/skills/ue-procedural-generation/SKILL.md +505 -0
- package/skills/ue-procedural-generation/references/pcg-node-reference.md +381 -0
- package/skills/ue-procedural-generation/references/procedural-mesh-patterns.md +940 -0
- package/skills/ue-project-context/SKILL.md +305 -0
- package/skills/ue-sequencer-cinematics/SKILL.md +506 -0
- package/skills/ue-sequencer-cinematics/references/sequencer-patterns.md +629 -0
- package/skills/ue-serialization-savegames/SKILL.md +524 -0
- package/skills/ue-serialization-savegames/references/save-system-architecture.md +705 -0
- package/skills/ue-state-trees/SKILL.md +489 -0
- package/skills/ue-state-trees/references/state-tree-mass-integration.md +184 -0
- package/skills/ue-state-trees/references/state-tree-patterns.md +321 -0
- package/skills/ue-testing-debugging/SKILL.md +520 -0
- package/skills/ue-testing-debugging/references/automation-test-patterns.md +387 -0
- package/skills/ue-testing-debugging/references/profiling-commands.md +357 -0
- package/skills/ue-ui-umg-slate/SKILL.md +431 -0
- package/skills/ue-ui-umg-slate/references/common-ui-setup.md +484 -0
- package/skills/ue-ui-umg-slate/references/widget-types.md +487 -0
- package/skills/ue-world-level-streaming/SKILL.md +518 -0
- package/skills/ue-world-level-streaming/references/streaming-patterns.md +414 -0
- package/templates/gamedev/unreal-project-context.md +107 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Property Specifiers Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for UPROPERTY(), UFUNCTION(), UCLASS(), USTRUCT(), and UENUM() specifiers in Unreal Engine 5.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## UPROPERTY() Specifiers
|
|
8
|
+
|
|
9
|
+
### Editor Visibility & Editability
|
|
10
|
+
|
|
11
|
+
| Specifier | Editable | Location |
|
|
12
|
+
|-----------|----------|----------|
|
|
13
|
+
| `EditAnywhere` | Yes | Instance + archetype Details panels |
|
|
14
|
+
| `EditDefaultsOnly` | Yes | Archetype (CDO) Details only, not instance |
|
|
15
|
+
| `EditInstanceOnly` | Yes | Instance Details only, not archetype |
|
|
16
|
+
| `VisibleAnywhere` | No (read-only) | Instance + archetype Details |
|
|
17
|
+
| `VisibleDefaultsOnly` | No | Archetype Details only |
|
|
18
|
+
| `VisibleInstanceOnly` | No | Instance Details only |
|
|
19
|
+
| `NoEditInline` | Suppresses | Hides inline object editor |
|
|
20
|
+
|
|
21
|
+
**None of the above** means the property does not appear in the Details panel at all.
|
|
22
|
+
|
|
23
|
+
### Blueprint Access
|
|
24
|
+
|
|
25
|
+
| Specifier | Read | Write |
|
|
26
|
+
|-----------|------|-------|
|
|
27
|
+
| `BlueprintReadWrite` | Yes | Yes |
|
|
28
|
+
| `BlueprintReadOnly` | Yes | No |
|
|
29
|
+
| `BlueprintGetter=FuncName` | Custom getter | No (use with BlueprintReadOnly) |
|
|
30
|
+
| `BlueprintSetter=FuncName` | No | Custom setter |
|
|
31
|
+
|
|
32
|
+
> BlueprintReadWrite cannot be combined with EditAnywhere without a Category. Always add `Category="..."`.
|
|
33
|
+
|
|
34
|
+
### Replication
|
|
35
|
+
|
|
36
|
+
| Specifier | Effect |
|
|
37
|
+
|-----------|--------|
|
|
38
|
+
| `Replicated` | Replicates to clients; must implement `GetLifetimeReplicatedProps` |
|
|
39
|
+
| `ReplicatedUsing=FuncName` | Replicates + calls named function on client when value changes (RepNotify) |
|
|
40
|
+
| `NotReplicated` | Explicitly marks as not replicated (for structs inheriting replicated struct) |
|
|
41
|
+
|
|
42
|
+
All replicated properties require `GetLifetimeReplicatedProps` override:
|
|
43
|
+
```cpp
|
|
44
|
+
void AMyActor::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
|
|
45
|
+
{
|
|
46
|
+
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
|
|
47
|
+
DOREPLIFETIME(AMyActor, Health);
|
|
48
|
+
DOREPLIFETIME_CONDITION(AMyActor, bIsAiming, COND_SkipOwner);
|
|
49
|
+
DOREPLIFETIME_CONDITION(AMyActor, PersonalScore, COND_OwnerOnly);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Replication Conditions (COND_*):**
|
|
54
|
+
|
|
55
|
+
| Condition | When Replicated |
|
|
56
|
+
|-----------|-----------------|
|
|
57
|
+
| `COND_None` | Always (default) |
|
|
58
|
+
| `COND_InitialOnly` | Only on initial send |
|
|
59
|
+
| `COND_OwnerOnly` | To owning client only |
|
|
60
|
+
| `COND_SkipOwner` | To all except owner |
|
|
61
|
+
| `COND_SimulatedOnly` | To simulated proxies only |
|
|
62
|
+
| `COND_AutonomousOnly` | To autonomous proxy only |
|
|
63
|
+
| `COND_InitialOrOwner` | Initial send or to owner |
|
|
64
|
+
| `COND_Custom` | Controlled by `SetCustomIsActiveOverride` |
|
|
65
|
+
|
|
66
|
+
### Serialization
|
|
67
|
+
|
|
68
|
+
| Specifier | Effect |
|
|
69
|
+
|-----------|--------|
|
|
70
|
+
| `Transient` | Not serialized; reset to default on load |
|
|
71
|
+
| `DuplicateTransient` | Not copied when object is duplicated |
|
|
72
|
+
| `TextExportTransient` | Excluded from text export |
|
|
73
|
+
| `NonTransactional` | Not recorded in undo/redo transaction |
|
|
74
|
+
| `SaveGame` | Included when using `UGameplayStatics::SaveGameToSlot` |
|
|
75
|
+
| `SkipSerialization` | Omit from serialization entirely |
|
|
76
|
+
|
|
77
|
+
### Delegates & Events
|
|
78
|
+
|
|
79
|
+
| Specifier | Effect |
|
|
80
|
+
|-----------|--------|
|
|
81
|
+
| `BlueprintAssignable` | Blueprint can bind to this multicast delegate |
|
|
82
|
+
| `BlueprintCallable` | Blueprint can call `Broadcast()` on this delegate |
|
|
83
|
+
| `BlueprintAuthorityOnly` | Only authority can bind/call |
|
|
84
|
+
|
|
85
|
+
### Meta Specifiers
|
|
86
|
+
|
|
87
|
+
Meta goes inside `meta=(...)` after the main specifiers:
|
|
88
|
+
|
|
89
|
+
```cpp
|
|
90
|
+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Stats",
|
|
91
|
+
meta=(
|
|
92
|
+
ClampMin="0.0",
|
|
93
|
+
ClampMax="100.0",
|
|
94
|
+
UIMin="0.0",
|
|
95
|
+
UIMax="100.0",
|
|
96
|
+
ToolTip="Character health, clamped to [0, 100]",
|
|
97
|
+
DisplayName="Health Points",
|
|
98
|
+
EditCondition="bHealthEnabled",
|
|
99
|
+
EditConditionHides,
|
|
100
|
+
AllowPrivateAccess="true"
|
|
101
|
+
))
|
|
102
|
+
float Health;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
| Meta Key | Effect |
|
|
106
|
+
|----------|--------|
|
|
107
|
+
| `ClampMin` / `ClampMax` | Hard clamps on numeric input |
|
|
108
|
+
| `UIMin` / `UIMax` | Slider range without hard clamp |
|
|
109
|
+
| `ToolTip` | Tooltip shown in Details panel |
|
|
110
|
+
| `DisplayName` | Override displayed property name |
|
|
111
|
+
| `Category` | Can also be set in meta for finer control |
|
|
112
|
+
| `EditCondition` | Boolean property that enables editing |
|
|
113
|
+
| `EditConditionHides` | Hides property (instead of graying out) when condition is false |
|
|
114
|
+
| `InlineEditConditionToggle` | Adds a checkbox next to another property for EditCondition |
|
|
115
|
+
| `AllowPrivateAccess` | Allows Blueprint access to private C++ property |
|
|
116
|
+
| `Units="cm"` | Shows unit label in editor |
|
|
117
|
+
| `MakeStructureDefaultValue` | Default value for struct members |
|
|
118
|
+
| `MustImplement` | For TSubclassOf<>, limits to classes implementing given interface |
|
|
119
|
+
| `MetaClass` | Restricts UClass* pickers to a specific base class |
|
|
120
|
+
| `RequiredAssetDataTags` | Filters asset picker by asset tags |
|
|
121
|
+
| `AssetBundles` | Controls bundle membership for soft references |
|
|
122
|
+
| `NoResetToDefault` | Hides "Reset to Default" arrow in Details |
|
|
123
|
+
| `NoClear` | Prevents setting object reference to null |
|
|
124
|
+
| `ShowOnlyInnerProperties` | Inline struct properties without a group header |
|
|
125
|
+
| `HideInDetailPanel` | Hidden in Details but still accessible in Blueprint |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## UFUNCTION() Specifiers
|
|
130
|
+
|
|
131
|
+
### Blueprint Interaction
|
|
132
|
+
|
|
133
|
+
| Specifier | Effect |
|
|
134
|
+
|-----------|--------|
|
|
135
|
+
| `BlueprintCallable` | Exposed as a Blueprint node with execution pin |
|
|
136
|
+
| `BlueprintPure` | No execution pin; no side effects implied |
|
|
137
|
+
| `BlueprintNativeEvent` | C++ provides `_Implementation`; Blueprint can override |
|
|
138
|
+
| `BlueprintImplementableEvent` | Blueprint must implement; C++ just declares |
|
|
139
|
+
| `BlueprintAuthorityOnly` | Only callable from authority in Blueprint |
|
|
140
|
+
| `BlueprintCosmetic` | Only callable on clients (cosmetic-only) |
|
|
141
|
+
|
|
142
|
+
**BlueprintNativeEvent pattern:**
|
|
143
|
+
```cpp
|
|
144
|
+
// .h
|
|
145
|
+
UFUNCTION(BlueprintNativeEvent, Category="Events")
|
|
146
|
+
FVector GetSpawnLocation();
|
|
147
|
+
virtual FVector GetSpawnLocation_Implementation();
|
|
148
|
+
|
|
149
|
+
// .cpp — always provide the _Implementation
|
|
150
|
+
FVector AMyActor::GetSpawnLocation_Implementation()
|
|
151
|
+
{
|
|
152
|
+
return GetActorLocation() + FVector(0.f, 0.f, 200.f);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Networking RPCs
|
|
157
|
+
|
|
158
|
+
| Specifier | Execution Site | Direction |
|
|
159
|
+
|-----------|---------------|-----------|
|
|
160
|
+
| `Server` | Runs on server | Client → Server |
|
|
161
|
+
| `Client` | Runs on owning client | Server → Client |
|
|
162
|
+
| `NetMulticast` | Runs on all (server + clients) | Server → All |
|
|
163
|
+
| `Reliable` | Guaranteed delivery (ordered) | — |
|
|
164
|
+
| `Unreliable` | Best effort, no ordering | — |
|
|
165
|
+
| `WithValidation` | Requires `_Validate` function | — |
|
|
166
|
+
|
|
167
|
+
```cpp
|
|
168
|
+
// Client RPC: runs on the owning client
|
|
169
|
+
UFUNCTION(Client, Reliable)
|
|
170
|
+
void ClientShowKillFeed(const FString& KillerName, const FString& VictimName);
|
|
171
|
+
void ClientShowKillFeed_Implementation(const FString& KillerName, const FString& VictimName);
|
|
172
|
+
|
|
173
|
+
// Server RPC with validation
|
|
174
|
+
UFUNCTION(Server, Reliable, WithValidation)
|
|
175
|
+
void ServerRequestInteract(AActor* Target);
|
|
176
|
+
void ServerRequestInteract_Implementation(AActor* Target);
|
|
177
|
+
bool ServerRequestInteract_Validate(AActor* Target) { return IsValid(Target); }
|
|
178
|
+
|
|
179
|
+
// NetMulticast: no validation allowed
|
|
180
|
+
UFUNCTION(NetMulticast, Unreliable)
|
|
181
|
+
void MulticastSpawnBloodDecal(FVector Location, FRotator Rotation);
|
|
182
|
+
void MulticastSpawnBloodDecal_Implementation(FVector Location, FRotator Rotation);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Other Function Specifiers
|
|
186
|
+
|
|
187
|
+
| Specifier | Effect |
|
|
188
|
+
|-----------|--------|
|
|
189
|
+
| `Exec` | Can be called from in-game console |
|
|
190
|
+
| `CallInEditor` | Adds a button in the Details panel to call the function |
|
|
191
|
+
| `Category="..."` | Groups the node in the Blueprint palette |
|
|
192
|
+
| `DisplayName="..."` | Override function display name in Blueprint |
|
|
193
|
+
| `meta=(DeprecatedFunction)` | Marks function as deprecated |
|
|
194
|
+
| `meta=(CompactNodeTitle="Name")` | Compact node title in Blueprint |
|
|
195
|
+
| `meta=(Keywords="search terms")` | Blueprint search keywords |
|
|
196
|
+
| `meta=(AdvancedDisplay="Param1,Param2")` | Hides params behind Advanced disclosure |
|
|
197
|
+
| `meta=(DefaultToSelf="Target")` | Pins this param to Self by default |
|
|
198
|
+
| `meta=(HidePin="Target")` | Hides a parameter pin in Blueprint |
|
|
199
|
+
| `meta=(ExpandEnumAsExecs="Result")` | Creates one exec pin per enum value |
|
|
200
|
+
| `meta=(Latent, LatentInfo="LatentInfo")` | Marks as async latent action |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## UCLASS() Specifiers
|
|
205
|
+
|
|
206
|
+
| Specifier | Effect |
|
|
207
|
+
|-----------|--------|
|
|
208
|
+
| `Blueprintable` | Blueprint can subclass |
|
|
209
|
+
| `BlueprintType` | Usable as Blueprint variable |
|
|
210
|
+
| `NotBlueprintable` | Blocks subclassing even if parent allows it |
|
|
211
|
+
| `Abstract` | Cannot be instantiated directly |
|
|
212
|
+
| `Config=<Name>` | Loads Config properties from `Default<Name>.ini` |
|
|
213
|
+
| `DefaultConfig` | Saves config to `Default<Name>.ini` instead of user ini |
|
|
214
|
+
| `Transient` | Not serialized to disk |
|
|
215
|
+
| `Deprecated` | Marks class deprecated; instances still load |
|
|
216
|
+
| `CollapseCategories` | All properties put in root category |
|
|
217
|
+
| `DontCollapseCategories` | Overrides parent `CollapseCategories` |
|
|
218
|
+
| `HideCategories=(Cat1,Cat2)` | Hides listed categories in Details |
|
|
219
|
+
| `ShowCategories=(Cat1)` | Un-hides categories hidden by parent |
|
|
220
|
+
| `HideDropdown` | Not shown in class picker dropdowns |
|
|
221
|
+
| `Meta=(ChildCanTick)` | Blueprint subclasses can tick |
|
|
222
|
+
| `MinimalAPI` | Exports only type metadata, not all symbols |
|
|
223
|
+
| `Within=<ClassName>` | Instance outer must be of given class |
|
|
224
|
+
| `CustomConstructor` | Generated constructor not auto-created |
|
|
225
|
+
| `EditInlineNew` | Can be created inline in Details panel |
|
|
226
|
+
| `DefaultToInstanced` | ObjectProperty with this class is instanced by default |
|
|
227
|
+
| `Intrinsic` | Class built into the engine binary |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## USTRUCT() Specifiers
|
|
232
|
+
|
|
233
|
+
| Specifier | Effect |
|
|
234
|
+
|-----------|--------|
|
|
235
|
+
| `BlueprintType` | Usable as Blueprint variable |
|
|
236
|
+
| `Atomic` | Always serialized as a unit (no partial deltas) |
|
|
237
|
+
| `NoExport` | No automatic UScriptStruct created; manually generated |
|
|
238
|
+
| `HasNoOpConstructor` | Has a no-op constructor (optimization hint) |
|
|
239
|
+
| `IsAlwaysAccessible` | struct data accessible even without RTTI |
|
|
240
|
+
|
|
241
|
+
**UE5 note:** Always use `GENERATED_BODY()` inside structs. `GENERATED_USTRUCT_BODY()` is deprecated.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## UENUM() Specifiers
|
|
246
|
+
|
|
247
|
+
| Specifier | Effect |
|
|
248
|
+
|-----------|--------|
|
|
249
|
+
| `BlueprintType` | Usable in Blueprint |
|
|
250
|
+
|
|
251
|
+
**UMETA per-value specifiers:**
|
|
252
|
+
|
|
253
|
+
| Meta Key | Effect |
|
|
254
|
+
|----------|--------|
|
|
255
|
+
| `DisplayName="Label"` | Override name shown in Blueprint/editor |
|
|
256
|
+
| `Hidden` | Hide this value from Blueprint picker |
|
|
257
|
+
| `ToolTip="text"` | Tooltip in editor |
|
|
258
|
+
|
|
259
|
+
```cpp
|
|
260
|
+
UENUM(BlueprintType)
|
|
261
|
+
enum class EGamePhase : uint8
|
|
262
|
+
{
|
|
263
|
+
PreGame UMETA(DisplayName="Pre-Game"),
|
|
264
|
+
InGame UMETA(DisplayName="In Game"),
|
|
265
|
+
PostGame UMETA(DisplayName="Post-Game"),
|
|
266
|
+
MAX UMETA(Hidden) // sentinel; hidden from pickers
|
|
267
|
+
};
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Enums used in replication must be `uint8` and fit in 8 bits. For larger enums use `TEnumAsByte<EMyEnum>` (UE4) or keep as `uint8`-backed enum class (UE5).
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## UINTERFACE() & IInterface
|
|
275
|
+
|
|
276
|
+
```cpp
|
|
277
|
+
// .h
|
|
278
|
+
UINTERFACE(MinimalAPI, Blueprintable)
|
|
279
|
+
class UDamageable : public UInterface
|
|
280
|
+
{
|
|
281
|
+
GENERATED_BODY()
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
class MYGAME_API IDamageable
|
|
285
|
+
{
|
|
286
|
+
GENERATED_BODY()
|
|
287
|
+
public:
|
|
288
|
+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category="Combat")
|
|
289
|
+
void TakeDamage(float Amount, AActor* Instigator);
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// Implementing class
|
|
293
|
+
UCLASS()
|
|
294
|
+
class AMyCharacter : public ACharacter, public IDamageable
|
|
295
|
+
{
|
|
296
|
+
GENERATED_BODY()
|
|
297
|
+
public:
|
|
298
|
+
virtual void TakeDamage_Implementation(float Amount, AActor* Instigator) override;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// Checking/casting via interface
|
|
302
|
+
if (SomeActor->Implements<UDamageable>())
|
|
303
|
+
{
|
|
304
|
+
IDamageable::Execute_TakeDamage(SomeActor, 25.f, this);
|
|
305
|
+
}
|
|
306
|
+
```
|