Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/StateTreeEvents.cpp
bob tellez 0189872e84 [Backout] - CL32082262
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Added support for event payload in transitions and event capture for states. (contributed)
- Transitions can now be set up to require a specific payload type and/or a gameplay tag
- Required transition event payload is visible to property bindind for transition conditions
- States can require an event type as enter condition, the event is captured when state is selected
- Required state event payload is visible to binding for state enter conditions, tasks and transistions

[CL 32113027 by bob tellez in ue5-main branch]
2024-03-07 23:49:50 -05:00

19 lines
615 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "StateTreeEvents.h"
#include "StateTreeTypes.h"
#include "VisualLogger/VisualLogger.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(StateTreeEvents)
void FStateTreeEventQueue::SendEvent(const UObject* Owner, const FGameplayTag& Tag, const FConstStructView Payload, const FName Origin)
{
if (Events.Num() >= MaxActiveEvents)
{
UE_VLOG_UELOG(Owner, LogStateTree, Error, TEXT("%s: Too many events send on '%s'. Dropping event %s"), ANSI_TO_TCHAR(__FUNCTION__), *GetNameSafe(Owner), *Tag.ToString());
return;
}
Events.Emplace(Tag, Payload, Origin);
}