ドキュメント

Unity Engine

Download Unity

Unity Engine

RemoveComponent

Removes a component from an entity.
読み終わるまでの所要時間 1 分最終更新 2日前

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.

RemoveComponent(Entity, ComponentTypeSet)

Removes components from an entity.
public static void RemoveComponent(Entity entity, in ComponentTypeSet types)

Parameters

entity

The entity.

The component types.

Remarks

This is one structural change, however many types the set holds. Types the entity doesn't have are skipped.