UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DataLayerAsset.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Engine/DataAsset.h"
9#include "UObject/Object.h"
10
12
13#include "DataLayerAsset.generated.h"
14
15class AActor;
16
17UENUM(BlueprintType)
27
28UCLASS(BlueprintType, editinlinenew, MinimalAPI)
30{
32
33 friend class UDataLayerConversionInfo;
34
35#if WITH_EDITOR
36 //~ Begin UObject interface
37 ENGINE_API virtual void PostLoad() override;
38 ENGINE_API virtual bool CanEditChange(const FProperty* InProperty) const override;
39 //~ End UObject interface
40
41public:
42 virtual bool CanEditDataLayerType() const;
43 ENGINE_API void SetType(EDataLayerType Type);
44 void SetDebugColor(FColor InDebugColor) { DebugColor = InDebugColor; }
47
48 virtual void OnCreated();
49#endif
50
51 ENGINE_API bool IsPrivate() const;
52
53 UFUNCTION(Category = "Data Layer", BlueprintCallable)
54 virtual EDataLayerType GetType() const { return DataLayerType; }
55
56 UFUNCTION(Category = "Data Layer|Runtime", BlueprintCallable)
57 bool IsRuntime() const { return !IsPrivate() && DataLayerType == EDataLayerType::Runtime; }
58
59 UFUNCTION(Category = "Data Layer|Runtime", BlueprintCallable)
60 FColor GetDebugColor() const { return DebugColor; }
61
62 bool SupportsActorFilters() const { return bSupportsActorFilters; }
63
64 UFUNCTION(Category = "Data Layer|Runtime", BlueprintCallable)
65 bool IsClientOnly() const { return IsRuntime() && LoadFilter == EDataLayerLoadFilter::ClientOnly; }
66
67 UFUNCTION(Category = "Data Layer|Runtime", BlueprintCallable)
68 bool IsServerOnly() const { return IsRuntime() && LoadFilter == EDataLayerLoadFilter::ServerOnly; }
69
70protected:
72 UPROPERTY(Category = "Data Layer", EditAnywhere)
73 EDataLayerType DataLayerType;
74
75 UPROPERTY(Category = "Actor Filter", EditAnywhere)
76 bool bSupportsActorFilters;
77
79 UPROPERTY(Category = "Runtime", EditAnywhere)
80 FColor DebugColor;
81
82 UPROPERTY(Category = "Runtime", EditAnywhere)
83 EDataLayerLoadFilter LoadFilter;
84};
bool IsRuntime(const UBodySetup *BS)
Definition BodySetup.cpp:381
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EDataLayerLoadFilter
Definition DataLayerAsset.h:19
EDataLayerType
Definition DataLayerType.h:9
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Actor.h:257
Definition UnrealType.h:174
Definition DataAsset.h:21
Definition DataLayerAsset.h:30
Definition Color.h:486
Definition SoftObjectPtr.h:174