Files
UnrealEngine/Engine/Plugins/Runtime/MassGameplay/Source/MassSmartObjects/Private/MassSmartObjectBehaviorDefinition.cpp
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

21 lines
873 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MassSmartObjectBehaviorDefinition.h"
#include "MassCommandBuffer.h"
#include "MassSmartObjectFragments.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(MassSmartObjectBehaviorDefinition)
void USmartObjectMassBehaviorDefinition::Activate(FMassCommandBuffer& CommandBuffer, const FMassBehaviorEntityContext& EntityContext) const
{
FMassSmartObjectTimedBehaviorFragment TimedBehaviorFragment;
TimedBehaviorFragment.UseTime = UseTime;
CommandBuffer.PushCommand<FMassCommandAddFragmentInstances>(EntityContext.EntityView.GetEntity(), TimedBehaviorFragment);
}
void USmartObjectMassBehaviorDefinition::Deactivate(FMassCommandBuffer& CommandBuffer, const FMassBehaviorEntityContext& EntityContext) const
{
CommandBuffer.RemoveFragment<FMassSmartObjectTimedBehaviorFragment>(EntityContext.EntityView.GetEntity());
}