返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
U

Unreal Engine

Avoid common Unreal mistakes — garbage collection, UPROPERTY macros, replication authority, and asset reference pitfalls.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,078
下载量
4
收藏
概述
安装方式
版本历史

Unreal Engine

## Garbage Collection - Raw pointers to UObjects get garbage collected — use `UPROPERTY()` to prevent - `UPROPERTY()` marks for GC tracking — without it, pointer becomes dangling - `TWeakObjectPtr` for optional references — doesn't prevent collection, check `IsValid()` - `NewObject<T>()` for UObjects — never raw `new`, GC won't track it ## UPROPERTY and UFUNCTION - `UPROPERTY()` required for Blueprint access — and for GC tracking - `UFUNCTION()` for Blueprint callable/events — also required for replication - `EditAnywhere` vs `VisibleAnywhere` — edit allows changes, visible is read-only - `BlueprintReadWrite` vs `BlueprintReadOnly` — controls Blueprint access level ## Actor Lifecycle - `BeginPlay` after all components initialized — safe to access components - Constructor runs on CDO (Class Default Object) — don't spawn actors or access world - `PostInitializeComponents` before BeginPlay — for component setup - `EndPlay` for cleanup — called on destroy and level transition ## Tick Performance - Disable tick when not needed — `PrimaryActorTick.bCanEverTick = false` - Use timers instead of tick + counter — `GetWorldTimerManager().SetTimer()` - Tick groups for ordering — `PrePhysics`, `DuringPhysics`, `PostPhysics` - Blueprint tick expensive — move hot logic to C++ ## Replication - Server is authority — clients request, server validates and replicates - `UPROPERTY(Replicated)` for variable sync — implement `GetLifetimeReplicatedProps` - `UFUNCTION(Server)` for client-to-server RPC — must be `Reliable` or `Unreliable` - `HasAuthority()` to check if server — before executing authoritative logic - `Role` and `RemoteRole` for network role checks — `ROLE_Authority` is server ## Asset References - Hard references load with parent — bloats memory, use for always-needed - Soft references (`TSoftObjectPtr`) load on demand — for optional or large assets - `LoadSynchronous()` or `AsyncLoad` for soft refs — don't access until loaded - Blueprint class references: `TSubclassOf<T>` — type-safe class selection ## Memory and Pointers - `TSharedPtr` for non-UObjects — reference counted, auto-deletes - `TUniquePtr` for exclusive ownership — can't copy, moves only - `MakeShared<T>()` for creation — single allocation for object and control block - Never mix raw `new/delete` with smart pointers — choose one pattern ## Common Mistakes - Accessing null actor in Blueprint — use `IsValid()` node before access - PIE (Play In Editor) vs packaged build differ — test shipping build - Hot reload corrupts Blueprints — close editor, build, reopen - `GetWorld()` null in constructor — world doesn't exist yet, use BeginPlay - Spawning in constructor crashes — defer to BeginPlay or later - `FString` for display, `FName` for identifiers — FName is hashed, faster comparison

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 unreal-engine-1776328323 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 unreal-engine-1776328323 技能

通过命令行安装

skillhub install unreal-engine-1776328323

下载 Zip 包

⬇ 下载 Unreal Engine v1.0.0

文件大小: 2.11 KB | 发布时间: 2026-4-17 13:48

v1.0.0 最新 2026-4-17 13:48
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部