Documentation

Unity Engine

Download Unity

Unity Engine

RemoveComponent

Removes a component from an entity.
Read time 1 minuteLast updated a day ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

RemoveComponent<T>(Entity)

Removes a component from an entity.
public static bool RemoveComponent<T>(Entity entity)

Parameters

entity

The entity.

Returns

Type

Description

boolFalse if the entity didn't have the component.

Remarks

This is a structural change.

RemoveComponent(Entity, ComponentType)

Removes a component from an entity.
public static bool RemoveComponent(Entity entity, ComponentType componentType)

Parameters

entity

The entity.

componentType

The component type.

Returns

Type

Description

boolFalse if the entity didn't have the component.

Remarks

This is a structural change.