Skip to content

Game.Tools.Hidden

Assembly:
Assembly-CSharp

Namespace:
Game.Tools

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
Hidden is an empty/tag component (zero-data) intended to mark or tag entities as "hidden" within ECS queries and systems. The StructLayout attribute (Sequential, Size = 1) ensures the struct occupies one byte to avoid zero-size issues across platforms and to keep memory layout predictable. As an IQueryTypeParameter it can be used directly in entity queries and query builders (e.g., WithAll/Without) to include or exclude hidden entities.


Fields

  • This struct declares no instance fields.
    An empty/tag component: it carries no data, only presence.

Properties

  • This type exposes no properties.
    Presence/absence of the component on an entity is the intended state.

Constructors

  • public Hidden() (implicit)
    The default parameterless constructor is provided implicitly for the struct; no explicit constructors are declared. The default value has no data.

Methods

  • This type declares no methods.
    Behavior is driven by presence/absence of the component in entity/component queries and systems.

Usage Example

// Mark an entity as hidden (conversion or runtime)
dstManager.AddComponent<Hidden>(entity);
// or
dstManager.AddComponentData(entity, new Hidden());

// Example conversion authoring:
public class HideAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        dstManager.AddComponent<Hidden>(entity);
    }
}

// Query examples:
// Process only visible entities (exclude hidden)
Entities.Without<Hidden>().ForEach((ref SomeComponent comp) => {
    // operate on visible entities
}).Schedule();

// Operate only on hidden entities
Entities.WithAll<Hidden>().ForEach((Entity e, ref Hidden h) => {
    // operate on hidden entities
}).Schedule();