Navigation
API > API/Runtime > API/Runtime/MassEntity > API/Runtime/MassEntity/FMassEntityManager > API/Runtime/MassEntity/FMassEntityManager/GetOrCreateSharedFragment
References
| Module | MassEntity |
| Header | /Engine/Source/Runtime/MassEntity/Public/MassEntityManager.h |
| Include | #include "MassEntityManager.h" |
template<typename T, typename... TArgs>
const FSharedStruct & GetOrCreateSharedFragment
(
TArgs &&... InArgs
)
Remarks
Returns or creates a shared struct associated to a given shared fragment set of values identified internally by a CRC. Use this overload when values can be provided as constructor arguments for the desired shared fragment type and that can be used directly to compute a CRC (i.e., UE::StructUtils::GetStructCrc32) e.g., USTRUCT() struct FIntSharedFragment : public FMassSharedFragment {
FIntSharedFragment(const int32 InValue) : Value(InValue) {}
int32 Value = 0; };
const FSharedStruct SharedStruct = EntityManager.GetOrCreateSharedFragment
@params InArgs List of arguments provided to the constructor of the desired fragment type FSharedStruct to the matching, or newly created shared fragment