Navigation
API > API/Runtime > API/Runtime/MassEntity > API/Runtime/MassEntity/FMassEntityManager > API/Runtime/MassEntity/FMassEntityManager/GetOrCreateConstSharedFragment
References
| Module | MassEntity |
| Header | /Engine/Source/Runtime/MassEntity/Public/MassEntityManager.h |
| Include | #include "MassEntityManager.h" |
template<typename T, typename... TArgs>
const FConstSharedStruct & GetOrCreateConstSharedFragment
(
const FConstStructView HashingHelperStruct,
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 a different struct should be used to compute a CRC (i.e., UE::StructUtils::GetStructCrc32) and values can be provided as constructor arguments for the desired const shared fragment type e.g.,
USTRUCT() struct FIntConstSharedFragmentParams {
FIntConstSharedFragmentParams(const int32 InValue) : Value(InValue) {}
int32 Value = 0; };
USTRUCT() struct FIntConstSharedFragment : public FMassConstSharedFragment {
FIntConstSharedFragment(const FIntConstSharedFragmentParams& InParams) : Value(InParams.Value) {}
int32 Value = 0; };
FIntConstSharedFragmentParams Params(123); const FConstSharedStruct SharedStruct = EntityManager.GetOrCreateConstSharedFragment
@params HashingHelperStruct Struct view passed to UE::StructUtils::GetStructCrc32 to compute the CRC @params InArgs List of arguments provided to the constructor of the desired fragment type FConstSharedStruct to the matching, or newly created shared fragment