HasComponent
Checks whether an entity has a specific type of component.
阅读时间1 分钟最后更新于 1 天前
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
HasComponent<T>(Entity)
Checks whether an entity has a specific type of component.
public static bool HasComponent<T>(Entity entity)
Parameters
The entity.
Returns
Type | Description |
|---|---|
| bool | True if the entity exists and has the component. |
HasComponent(Entity, ComponentType)
Checks whether an entity has a specific type of component.
public static bool HasComponent(Entity entity, ComponentType type)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the entity exists and has the component. |