Class: USystemsSubsystem
class SYSTEMS_API USystemsSubsystem
: public UGameInstanceSubsystem;
Reflection-enabled
Global accessible registry of systems worlds.
Architecture book page explains more in depth how to interact with systems subsystem, but in a brief: This is a registry of globally accessible systems worlds game can have at any time.
Example
UCLASS()
class EXAMPLE_API UExampleGameInstance : public UGameInstance
{
GENERATED_BODY()
private:
virtual void Init() override;
};
void UExampleGameInstance::Init()
{
Super::Init();
auto* Subsystem = USystemsSubsystem::Get(GetWorld());
if (IsValid(Subsystem))
{
Subsystem->AcquireSystemsWorld(FName(),
[&](auto& Systems)
{
Systems.RegisterComponent<UShiaComponent>();
Systems.InstallResource<UShiaSettings>();
Systems.InstallLambdaSystem(JustDoItSystem, FInstallSystemOptions("JustDoIt"));
});
}
}
Methods
-
AcquireSystemsWorldpublic: void AcquireSystemsWorld( FName Id, TFunction<SystemSetupFunctor> SetupFunctor );
Create, setup and register new systems world.
Example
UCLASS() class EXAMPLE_API AExampleGameMode : public AGameModeBase { GENERATED_BODY() private: virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override; virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; }; void AExampleGameMode::InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) { Super::InitGame(MapName, Options, ErrorMessage); auto* Subsystem = USystemsSubsystem::Get(GetWorld()); if (IsValid(Subsystem)) { Subsystem->AcquireSystemsWorld(FName(), [&](auto& Systems) { Systems.RegisterComponent<UShiaComponent>(); Systems.InstallResource<UShiaSettings>(); Systems.InstallLambdaSystem(JustDoItSystem, FInstallSystemOptions("JustDoIt")); }); } } void AExampleGameMode::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); auto* Subsystem = USystemsSubsystem::Get(GetWorld()); if (IsValid(Subsystem)) { Subsystem->ReleaseSystemsWorld(ThisClass::SYSTEMS_WORLD); } }
Arguments
-
IdFName IdSystems world ID.
-
SetupFunctorTFunction<SystemSetupFunctor> SetupFunctorFunction/lambda that performs setup of created systems world.
Note
SystemSetupFunctorhas given signature:void(USystemsWorld& Systems).
-
-
BlueprintAcquireSystemsWorldpublic: void BlueprintAcquireSystemsWorld( FName Id, FOnSetupSystemsWorld SetupDelegate );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = Systems|Subsystem
Meta Specifiers:
- DisplayName = Acquire Systems World
Create, setup and register new systems world.
Blueprint-side version of
USystemsSubsystem::AcquireSystemsWorld.
Arguments
-
IdFName IdSystems world ID.
-
SetupDelegateFOnSetupSystemsWorld SetupDelegateDelegate that performs setup of created systems world.
Note
This delegate has given signature:
void(USystemsWorld* Systems).
-
Getpublic: static USystemsSubsystem* Get( UWorld* World ); -
GetSystemsWorldpublic: USystemsWorld* GetSystemsWorld( FName Id );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = Systems|Subsystem
Meta Specifiers:
- Displayname = Get Systems World
Gets systems world by its label.
Arguments
-
IdFName IdSystems world ID.
-
GetSystemsWorldsIdspublic: void GetSystemsWorldsIds( TSet<FName>& Output ) const; -
ReleaseSystemsWorldpublic: void ReleaseSystemsWorld( FName Id );
Reflection-enabled
Specifiers:
- BlueprintCallable
- Category = Systems|Subsystem
Meta Specifiers:
- Displayname = Release Systems World
Unregister given systems world.
Example
UCLASS() class EXAMPLE_API AExampleGameMode : public AGameModeBase { GENERATED_BODY() private: virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override; virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; }; void AExampleGameMode::InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) { Super::InitGame(MapName, Options, ErrorMessage); auto* Subsystem = USystemsSubsystem::Get(GetWorld()); if (IsValid(Subsystem)) { Subsystem->AcquireSystemsWorld(FName(), [&](auto& Systems) { Systems.RegisterComponent<UShiaComponent>(); Systems.InstallResource<UShiaSettings>(); Systems.InstallLambdaSystem(JustDoItSystem, FInstallSystemOptions("JustDoIt")); }); } } void AExampleGameMode::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); auto* Subsystem = USystemsSubsystem::Get(GetWorld()); if (IsValid(Subsystem)) { Subsystem->ReleaseSystemsWorld(ThisClass::SYSTEMS_WORLD); } }
Arguments
-
IdFName Id
Documentation built with Unreal-Doc v1.0.8 tool by PsichiX