文档

Unity Engine

Download Unity

Unity Engine

IsComponentEnabled

Checks whether the IComponentData of type T is enabled on the specified Entity. 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.
阅读时间1 分钟最后更新于 19 天前

Definition

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

IsComponentEnabled(Entity)

Checks whether the IComponentData of type T is enabled on the specified Entity. 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 bool IsComponentEnabled(Entity entity)

Parameters

entity

The entity whose component should be checked.

Returns

Type

Description

boolTrue if the specified component is enabled, or false if it is disabled.

Remarks

IsComponentEnabled(SystemHandle)

Checks whether the IComponentData of type T is enabled on the specified system using a SystemHandle. 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 bool IsComponentEnabled(SystemHandle systemHandle)

Parameters

systemHandle

The system whose component should be checked.

Returns

Type

Description

boolTrue if the specified component is enabled, or false if it is disabled.

Remarks