Navigation
API > API/Runtime > API/Runtime/MassEntity > API/Runtime/MassEntity/FMassEntityManager
Description
Adds a new const shared fragment to the given entity if it doesn't have a shared fragment of the given type, moves it to its new archetype and notify observers. In case a fragment of that type is already present, then it replaces it, moves the entity to its new chunk within the archetype and notifies the observers.
| Name | SwapConstSharedFragmentForEntity |
| Type | function |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassEntityManager.h |
| Include Path | #include "MassEntityManager.h" |
| Source | /Engine/Source/Runtime/MassEntity/Private/MassEntityManager.cpp |
bool SwapConstSharedFragmentForEntity
(
const FMassEntityHandle EntityHandle,
const FConstSharedStruct & InConstSharedFragment
)
whether the Fragment value is valid and successfully assigned to the entity (added or replaced)