Files
UnrealEngine/Engine/Plugins/Experimental/SceneState/Source/SceneStateEvent/Public/SceneStateEventTemplate.h
2025-05-18 13:04:45 +08:00

49 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "SceneStateEventSchemaHandle.h"
#include "StructUtils/InstancedStruct.h"
#include "SceneStateEventTemplate.generated.h"
/** Defines a handle to an event schema and the payload event data to copy to events to push */
USTRUCT(BlueprintType)
struct FSceneStateEventTemplate
{
GENERATED_BODY()
const FSceneStateEventSchemaHandle& GetEventSchemaHandle() const
{
return EventSchemaHandle;
}
const FInstancedStruct& GetEventData() const
{
return EventData;
}
#if WITH_EDITOR
/** Syncs the event data to match the event schema struct */
SCENESTATEEVENT_API void SyncEventData();
#endif
static FName GetEventSchemaHandlePropertyName()
{
return GET_MEMBER_NAME_CHECKED(FSceneStateEventTemplate, EventSchemaHandle);
}
static FName GetEventDataPropertyName()
{
return GET_MEMBER_NAME_CHECKED(FSceneStateEventTemplate, EventData);
}
private:
/** Handle to the event schema to use */
UPROPERTY(EditAnywhere, Category="Event")
FSceneStateEventSchemaHandle EventSchemaHandle;
/** Data initialized to the event schema, if it has a valid event struct */
UPROPERTY(EditAnywhere, Category="Event", meta=(StructTypeConst))
FInstancedStruct EventData;
};