Documentation

Unity Engine

Unity Engine

SetComponentData<T>(Entity, T)

Sets the value of a component of an entity.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public void SetComponentData<T>(Entity entity, T componentData) where T : unmanaged, IComponentData

Parameters

entity

The entity whose
T
component should be modified.

componentData

T
The value to assign to
entity
's
T
component.

Remarks

The target entity must exist, and it must have the target component.