ドキュメント

Unity Engine

Download Unity

Unity Engine

SetComponentData

Sets the value of a component of an entity.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

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

SetComponentData<T>(Entity, T)

Sets the value of a component of an entity.
public void SetComponentData<T>(Entity entity, T componentData) where T : unmanaged, IComponentData

Parameters

entity

The entity whose
T
component should be modified.

componentData

T
The value to assign to
entity
's
T
component.

Remarks

The target entity must exist, and it must have the target component.

SetComponentData<T>(SystemHandle, T)

Sets the value of a component of an entity associated with a system.
public void SetComponentData<T>(SystemHandle system, T componentData) where T : unmanaged, IComponentData

Parameters

Handle to the system whose entity's
T
component should be modified.

componentData

T
The value to assign to the
T
component.

Remarks

The target entity must exist, and it must have the target component.