UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ObjectEditorOptionalSupport.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#include "
CoreTypes.h
"
6
#include "
Misc/NotNull.h
"
7
8
#if WITH_EDITORONLY_DATA
9
10
class
FArchive
;
11
class
UObject
;
12
class
UClass
;
13
struct
FGuid
;
14
15
namespace
UE::EditorOptional
16
{
17
18
COREUOBJECT_API
void
ConditionalUpgradeObject
(
FArchive
& Ar,
TNotNull<UObject*>
SecondaryObject
,
const
FGuid
& VersionGuid,
int
Version);
19
20
COREUOBJECT_API
void
UpgradeObject
(
FArchive
& Ar,
TNotNull<UObject*>
SecondaryObject
);
21
22
COREUOBJECT_API
UObject
*
CreateEditorOptionalObject
(
TNotNull<UObject*>
MainObject
,
TNotNull<const UClass*>
EditorOptionalClass
,
const
TCHAR
*
OverrideName
=
nullptr
);
23
24
template
<
typename
EditorOptionalClass>
25
EditorOptionalClass
*
CreateEditorOptionalObject
(
TNotNull<UObject*>
MainObject
)
26
{
27
// use the non-templated version of this function, and typecast the result (we don't need CastChecked since we know it's the right class)
28
return
Cast<EditorOptionalClass>
(
CreateEditorOptionalObject
(
MainObject
, EditorOptionalClass::StaticClass()));
29
}
30
}
31
32
#endif
CoreTypes.h
TCHAR
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition
Platform.h:1135
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
NotNull.h
TNotNull
T TNotNull
Definition
NotNull.h:307
FArchive
Definition
Archive.h:1208
UClass
Definition
Class.h:3793
UObject
Definition
Object.h:95
FGuid
Definition
Guid.h:109
Engine
Source
Runtime
CoreUObject
Public
UObject
ObjectEditorOptionalSupport.h
Generated by
1.9.8