Navigation
API > API/Runtime > API/Runtime/MassEntity > API/Runtime/MassEntity/FMassEntityManager
Description
Adds a new shared fragment to the given entity. Note that it only works if the given entity doesn't have a shared fragment of the given type. The function will give a soft "pass" if the entity has the shared fragment of the same value. Setting shared fragment value (i.e. changing) is not supported and the function will log a warning if that's attempted.
| Name | AddSharedFragmentToEntity |
| 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 AddSharedFragmentToEntity
(
const FMassEntityHandle EntityHandle,
const FSharedStruct & InSharedFragment
)
whether the entity has the Fragment value assigned to it, regardless of its original state (i.e. the function will return true also if the entity already had the same values associated with it)