TEntityBuilder

[TEntityBuilder](API\Runtime\MovieScene\EntitySystem\TEntityBuilder) is a utility class that can be used to marshal type-safe component data into entites, either on construction or mutation of an existing entity.

Windows
MacOS
Linux

Inheritance Hierarchy

TEntityBuilderImpl

TEntityBuilder

References

Module

MovieScene

Header

/Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntityBuilder.h

Include

#include "EntitySystem/MovieSceneEntityBuilder.h"

Syntax

template<typename... T>
struct TEntityBuilder : public UE::MovieScene::TEntityBuilderImpl< TMakeIntegerSequence< int, sizeof...(T)>, T... >

Remarks

TEntityBuilder is a utility class that can be used to marshal type-safe component data into entites, either on construction or mutation of an existing entity. It is a general purpose utility that should not be used for high-performance code, but is useful for one-off changes to entity component structures

In general, this type is intended to be used declaratively, and will forward its state to the final function call (to prevent a copy of the payload data)

Example usage:

TComponentTypeID<float> FloatComponent1 = ...; TComponentTypeID<float> FloatComponent2 = ...; TComponentTypeID<FMovieSceneFloatChannel> FloatChannel = ...;

FMovieSceneFloatChannel NewChannelType; NewChannelType.SetDefault(1.f);

auto EntityBuilder = FEntityBuilder() .AddDefaulted(FloatComponent1) .AddDefaulted(FloatComponent2) .Add(FloatChannel, MoveTemp(NewChannelType));

Create a new entity with 2 defaulted floats, and a float channel with a default of 1.f FMovieSceneEntityID NewEntity = CopyTemp(EntityBuilder).CreateEntity(EntityManager);

Add the data to an existing entity - will invalidate the entity builder EntityBuilder.MutateExisting(EntityManager, Existing);

Constructors

Name Description

Public function

TEntityBuilder()

Public function

TEntityBuilder

(
    Args&&... InTypes
)

Typedefs

Name

Description

Super

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss