UMassEntitySubsystem::CreateArchetype

Creates an archetype like SourceArchetype + NewFragmentList.

Choose your operating system:

Windows

macOS

Linux

References

Module

MassEntity

Header

/Engine/Plugins/Runtime/MassEntity/Source/MassEntity/Public/MassEntitySubsystem.h

Include

#include "MassEntitySubsystem.h"

Source

/Engine/Plugins/Runtime/MassEntity/Source/MassEntity/Private/MassEntitySubsystem.cpp

Syntax

FArchetypeHandle CreateArchetype
(
    const TSharedPtr< FMassArchetypeData > & SourceArchetype,
    const FMassFragmentBitSet & NewFragmentList
)

Remarks

Creates an archetype like SourceArchetype + NewFragmentList.

that adding an empty list is not supported and doing so will result in failing a `check_

Returns

a handle of a new archetype @note it's caller's responsibility to ensure that NewFragmentList is not empty and contains only fragment types that SourceArchetype doesn't already have. If the caller cannot guarantee it use of AddFragment functions family is recommended.

Parameters

Parameter

Description

SourceArchetype

the archetype used to initially populate the list of fragments of the archetype being created.

NewFragmentList

list of unique fragments to add to fragments fetched from SourceArchetype.