Navigation
API > API/Runtime > API/Runtime/Engine
Subsystems are auto instanced classes that share the lifetime of certain engine constructs
Currently supported Subsystem lifetimes are: Engine -> inherit UEngineSubsystem Editor -> inherit UEditorSubsystem GameInstance -> inherit UGameInstanceSubsystem World -> inherit UWorldSubsystem LocalPlayer -> inherit ULocalPlayerSubsystem
Normal Example: class UMySystem : public UGameInstanceSubsystem Which can be accessed by: UGameInstance* GameInstance = ...; UMySystem* MySystem = GameInstance->GetSubsystem
or the following if you need protection from a null GameInstance UGameInstance* GameInstance = ...; UMyGameSubsystem* MySubsystem = UGameInstance::GetSubsystem
You can get also define interfaces that can have multiple implementations. Interface Example : MySystemInterface With 2 concrete derivative classes: MyA : public MySystemInterface MyB : public MySystemInterface
Which can be accessed by: UGameInstance* GameInstance = ...; const TArray
| Name | USubsystem |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Subsystems/Subsystem.h |
| Include Path | #include "Subsystems/Subsystem.h" |
Syntax
UCLASS (Abstract, MinimalAPI)
class USubsystem : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → USubsystem
Derived Classes
USubsystem derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
USubsystem() |
Subsystems/Subsystem.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InternalOwningSubsystem | FSubsystemCollectionBase * | Subsystems/Subsystem.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Deinitialize() |
Implement this for deinitialization of instances of the system | Subsystems/Subsystem.h | |
virtual void Initialize
(
FSubsystemCollectionBase& Collection |
Implement this for initialization of instances of the system | Subsystems/Subsystem.h | |
virtual bool ShouldCreateSubsystem
(
UObject* Outer |
Override to control if the Subsystem should be created at all. | Subsystems/Subsystem.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Overridden to check global network context | Subsystems/Subsystem.h |