Documentation

Unity Engine

Download Unity

Unity Engine

AddComponentData<T>(Entity, T)

Adds a component to an entity and sets its value.
Read time 1 minuteLast updated a day ago

Definition

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

Parameters

entity

The entity.

componentData

T
The value.

Returns

Type

Description

boolFalse if the entity already had the component, in which case only its value is set.

Remarks

This is a structural change.