Navigation
API > API/Runtime > API/Runtime/MassEntity
Builds reserved entities with fragment values AND shared fragment values. Entities with the same shared fragment values are grouped for efficient archetype creation. Inherits data management from FMassCommandAddFragmentInstancesWithSharedFragments; only Run() differs. Uses PushCommand for cross-chunk batching.
Note: TSharedFragmentValues is always FMassArchetypeSharedFragmentValues but is a template param to maintain uniform PushCommand interface (all params in one typename... list).
Example: FMassEntityHandle Entity = EntityManager->ReserveEntity(); FMassArchetypeSharedFragmentValues SharedValues; SharedValues.Add(EntityManager->GetOrCreateConstSharedFragment(FMySharedFragment(42))); Context.Defer().PushCommand
Supported types: FMassFragment + FMassTag (including sparse). Shared fragments via FMassArchetypeSharedFragmentValues. Breakpoint support: Yes — CheckCreateEntityBreakpoints called at PushCommand time.
| Name | FMassCommandBuildEntityWithSharedFragments |
| Type | struct |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassCommands.h |
| Include Path | #include "MassCommands.h" |
Syntax
template<typename TSharedFragmentValues, typename... TOthers>
struct FMassCommandBuildEntityWithSharedFragments : public FMassCommandAddFragmentInstancesWithSharedFragments< TSharedFragmentValues, TOthers... >
Inheritance Hierarchy
- FMassBatchedCommand → FMassCommandAddFragmentInstancesWithSharedFragments → FMassCommandBuildEntityWithSharedFragments
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMassCommandBuildEntityWithSharedFragments() |
MassCommands.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Super | FMassCommandAddFragmentInstancesWithSharedFragments< TSharedFragmentValues, TOthers... > | MassCommands.h |
Functions
Public
Protected Virtual
Overridden from FMassBatchedCommand
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Run
(
FMassEntityManager& EntityManager |
MassCommands.h |