ドキュメント

Unity Engine

Download Unity

Unity Engine

AddComponent

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

Definition

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

AddComponent<T>(Entity)

Adds a component to an entity.
public static bool AddComponent<T>(Entity entity)

Parameters

entity

The entity.

Returns

Type

Description

boolFalse if the entity already had the component.

Remarks

This is a structural change.

AddComponent(Entity, ComponentType)

Adds a component to an entity.
public static bool AddComponent(Entity entity, ComponentType componentType)

Parameters

entity

The entity.

componentType

The component type.

Returns

Type

Description

boolFalse if the entity already had the component.

Remarks

This is a structural change.

AddComponent(Entity, ComponentTypeSet)

Adds components to an entity.
public static void AddComponent(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 already has are skipped.