UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PreviewAssetAttachComponent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
9#pragma once
10
11#include "CoreMinimal.h"
13#include "UObject/Object.h"
15#include "PreviewAssetAttachComponent.generated.h"
16
18USTRUCT()
20{
22
23private:
25 UPROPERTY()
26 TSoftObjectPtr<class UObject> AttachedObject;
27
28#if WITH_EDITORONLY_DATA
29 UPROPERTY()
31#endif
32
33public:
34
36#if WITH_EDITORONLY_DATA
38#endif
39 {}
40
42 UPROPERTY()
43 FName AttachedTo;
44
45 void SaveAttachedObjectFromDeprecatedProperty()
46 {
47#if WITH_EDITORONLY_DATA
49 {
50 AttachedObject = Object_DEPRECATED;
52 }
53#endif
54 }
55
57 {
58 return AttachedObject.LoadSynchronous();
59 }
60
61 void SetAttachedObject(UObject* InObject)
62 {
63 AttachedObject = InObject;
64 }
65};
66
67// Iterators
70
72USTRUCT()
74{
76
77public:
84 ENGINE_API void AddAttachedObject( UObject* AttachObject, FName AttachPointName );
85
92 ENGINE_API void AddUniqueAttachedObject(UObject* AttachObject, FName AttachPointName);
93
99 ENGINE_API void RemoveAttachedObject( UObject* ObjectToRemove, FName AttachName );
100
107 ENGINE_API UObject* GetAttachedObjectByAttachName( FName AttachName ) const;
108
112 ENGINE_API void ClearAllAttachedObjects();
113
117 ENGINE_API int32 Num() const;
118
123
127 ENGINE_API const FPreviewAttachedObjectPair& operator[](int32 i) const;
128
132 ENGINE_API TConstIterator CreateConstIterator() const;
133
137 ENGINE_API TIterator CreateIterator();
138
145 inline void RemoveAtSwap(int32 Index, int32 Count, bool bAllowShrinking)
146 {
147 RemoveAtSwap(Index, Count, bAllowShrinking ? EAllowShrinking::Yes : EAllowShrinking::No);
148 }
149
153 ENGINE_API void SaveAttachedObjectsFromDeprecatedProperties();
154
158 ENGINE_API int32 ValidatePreviewAttachedObjects();
159
160private:
161 UPROPERTY()
162 TArray<FPreviewAttachedObjectPair> AttachedObjects;
163};
#define NULL
Definition oodle2base.h:134
EAllowShrinking
Definition AllowShrinking.h:10
#define UE_ALLOWSHRINKING_BOOL_DEPRECATED(FunctionName)
Definition AllowShrinking.h:31
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Num
Definition MetalRHIPrivate.h:234
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
TIndexedContainerIterator< const TArray< FPreviewAttachedObjectPair >, const FPreviewAttachedObjectPair, int32 > TConstIterator
Definition PreviewAssetAttachComponent.h:69
TIndexedContainerIterator< TArray< FPreviewAttachedObjectPair >, FPreviewAttachedObjectPair, int32 > TIterator
Definition PreviewAssetAttachComponent.h:68
Definition NameTypes.h:617
Definition Array.h:670
Definition Array.h:64
Definition Object.h:95
U16 Index
Definition radfft.cpp:71
Definition PreviewAssetAttachComponent.h:74
Definition PreviewAssetAttachComponent.h:20
UObject * GetAttachedObject() const
Definition PreviewAssetAttachComponent.h:56
void SetAttachedObject(UObject *InObject)
Definition PreviewAssetAttachComponent.h:61
FPreviewAttachedObjectPair()
Definition PreviewAssetAttachComponent.h:35
Definition ObjectPtr.h:488
Definition SoftObjectPtr.h:174
T * LoadSynchronous() const
Definition SoftObjectPtr.h:514