UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PlatformSettingsManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Containers/Map.h"
8#include "CoreMinimal.h"
9#include "DeveloperSettings.h"
10#include "HAL/Platform.h"
11#include "Templates/Casts.h"
13#include "UObject/NameTypes.h"
14#include "UObject/Object.h"
16#include "UObject/ObjectPtr.h"
18
19#include "PlatformSettingsManager.generated.h"
20
22
23// List of platform-specific instances for a class
24USTRUCT()
26{
28
29 // The instance for the native platform
31 TObjectPtr<UPlatformSettings> PlatformInstance = nullptr;
32
33 // Instances for other platforms (only used in the editor)
36};
37
38// The manager for all platform-specific settings
39UCLASS(MinimalAPI)
41{
43
44public:
46
48 {
50 }
51
52 // Returns the platform settings for the specified class for the current platform
54
55 // Returns the platform settings for the specified class for the specified platform
57
58 DEVELOPERSETTINGS_API FName GetCurrentPlatformName() const;
59
60#if WITH_EDITOR
61 // Gets the simulated platform
63
64 // Sets the current simulated platform
66#endif
67
68
69public:
70 template <typename TPlatformSettingsClass>
72 {
73 return CastChecked<TPlatformSettingsClass>(GetSettingsForPlatform(TPlatformSettingsClass::StaticClass()));
74 }
75
76#if WITH_EDITOR
78
79 template <typename TPlatformSettingsClass>
81 {
82 return GetAllPlatformSettings(TPlatformSettingsClass::StaticClass());
83 }
84
86
87 template <typename TPlatformSettingsClass>
88 inline TPlatformSettingsClass* GetSettingsForPlatform(FName TargetIniPlatformName) const
89 {
90 return Cast<TPlatformSettingsClass>(GetSettingsForPlatform(TPlatformSettingsClass::StaticClass(), TargetIniPlatformName));
91 }
92
93#endif
94
95private:
96 // Creates a settings object for the specified class and platform
98
99
100private:
101 // Created platform-specific settings
104
105 // The true platform name for the current platform (unaffected by previews, etc...)
106 FName IniPlatformName;
107
108#if WITH_EDITOR
109 // Current simulated platform
111#endif
112};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
static COREUOBJECT_API FObjectInitializer & Get()
Definition UObjectGlobals.cpp:5001
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SubclassOf.h:30
Definition Object.h:95
Definition PlatformSettingsManager.h:41
static const UPlatformSettingsManager & Get()
Definition PlatformSettingsManager.h:47
TPlatformSettingsClass * GetSettingsForPlatform() const
Definition PlatformSettingsManager.h:71
Definition PlatformSettings.h:59
Definition PlatformSettingsManager.h:26
Definition ObjectPtr.h:488