Documentation

Unity Engine

Download Unity

Unity Engine

AddSharedComponent<T>(Entity, T)

Adds a shared component to an entity.
Read time 1 minuteLast updated a day ago

Definition

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

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.