中EN

UWorldSubsystem / UWorld::GetSubsystem API

  • UWorldSubsystem (Subsystems/WorldSubsystem.h; UCLASS Abstract; USubsystem → UWorldSubsystem): "Base class for auto instanced and initialized systems that share the lifetime of a UWorld"; FWorldSubsystemCollection calls PostInitialize and OnWorldBeginPlay for already initialized worlds.
  • Virtuals: PostInitialize ("Called once all UWorldSubsystems have been initialized"), OnWorldBeginPlay ("when world is ready to start gameplay before the game mode transitions to the correct state and call BeginPlay on all actors"), OnWorldComponentsUpdated, OnWorldEndPlay, PreDeinitialize. ShouldCreateSubsystem "Calls DoesSupportWorldType to check if this subsystem should be created"; DoesSupportWorldType(EWorldType) "Override this to change what types of worlds support this subsystem." Derived: UTickableWorldSubsystem, UMassSubsystemBase, UDataLayerSubsystem, UEnhancedInputWorldSubsystem, USmartObjectSubsystem, UWorldPartitionHLODRuntimeSubsystem, etc.
  • UWorld::GetSubsystem (API/Runtime/Engine/UWorld/GetSubsystem; Engine/World.h): template<typename TSubsystemClass> TSubsystemClass* GetSubsystem() const — "Get a Subsystem of specified type"; static overload GetSubsystem(const UWorld* World) returns nullptr if not found or null.

引用这一章的笔记

输入关键词开始搜索

滚轮或双指缩放 · 拖动平移 · 双击放大 / 还原