Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.09 KB

subsystems.md

File metadata and controls

35 lines (23 loc) · 1.09 KB
title layout
Subsystems
default

Subsystems

UnrealSharp supports any of the engine's subsytem classes. These classes are great way to create singletons in Unreal Engine.

Subsystem names in UnrealSharp

The only difference is that you need to inherit from the CS wrapper, due to the lack of reflection exposed functions in the engine's subsystem classes.

// This WorldSubsystem supports Tick aswell. UTickableWorldSubsystem doesn't exist in UnrealSharp.
UWorldSubsystem => UCSWorldSubsystem

UGameInstanceSubsystem => UCSGameInstanceSubsystem

UEngineSubsystem => UCSEngineSubsystem

ULocalPlayerSubsystem => UCSLocalPlayerSubsystem

Getting Subsystems

Getting the subsystems are really simple, you just do any of the following, depending on what type of subsystem you inherit from:

GetWorldSubsystem<UMyWorldSubsystem>();
GetGameInstanceSubsystem<UMyGameInstanceSubsystem>();
GetLocalPlayerSubsystem<UMyLocalPlayerSubsystem>(OwningPlayerController);
GetEngineSubsystem<UMyEngineSubsystem>();