ドキュメント

Unity Engine

Download Unity

Unity Engine

SetComponentEnabled

Enable or disable the IComponentData of type T on the specified system using a SystemHandle. This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, a system with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

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

SetComponentEnabled(SystemHandle, bool)

Enable or disable the IComponentData of type T on the specified system using a SystemHandle. This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, a system with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
public void SetComponentEnabled(SystemHandle systemHandle, bool value)

Parameters

systemHandle

The system whose component should be enabled or disabled.

value

True if the specified component should be enabled, or false if it should be disabled.

Remarks

SetComponentEnabled(Entity, bool)

Enable or disable the IComponentData of type T on the specified Entity. This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
public void SetComponentEnabled(Entity entity, bool value)

Parameters

entity

The entity whose component should be enabled or disabled.

value

True if the specified component should be enabled, or false if it should be disabled.

Remarks