Method MoveComponent
MoveComponent<T>(EntityCommandBuffer, Entity, Entity)
Records a command to safely move a managed component (and its current value) from one entity to another
Declaration
public static void MoveComponent<T>(this EntityCommandBuffer ecb, Entity src, Entity dst) where T : class, IComponentData, new()
Parameters
Type | Name | Description |
---|---|---|
EntityCommandBuffer | ecb | This entity command buffer. |
Entity | src | The entity whose |
Entity | dst | The Entity the managed component will be added to. If this entity already has
|
Type Parameters
Name | Description |
---|---|
T | The type of component to move. Must be a managed type. |
Remarks
At playback, this command throws an error if this entity is destroyed before playback, if this entity is still deferred, or adding this componentType makes the archetype too large.
Exceptions
Type | Condition |
---|---|
NullReferenceException | Throws if an Allocator was not passed in when the EntityCommandBuffer was created. |
InvalidOperationException | Throws if this EntityCommandBuffer has already been played back. |
ArgumentException | Throws if |