Skip to content

Game.Prefabs.FloodData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
A marker/tag component (empty value type) used to mark entities/prefabs that are related to flooding behavior. The struct is declared with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a non-zero marshalled size (1 byte). This is commonly done to avoid certain interop/IL2CPP or engine-specific handling of zero-sized components and to ensure predictable layout when required by native code or reflection-based systems. The type contains no runtime data — it exists only to be present/absent on an entity for queries and logic branching.


Fields

  • This component defines no fields; it is an empty/tag component.
    The StructLayout attribute is present to ensure the type has a non-zero size when marshalled.

Properties

  • This component exposes no properties.

Constructors

  • No explicit constructors are defined. The type uses the default value-type (parameterless) constructor.

Methods

  • No methods are defined on this type.

Usage Example

// Add the tag to an entity via an EntityManager:
entityManager.AddComponentData(entity, new FloodData());

// Create a query that selects all entities that have the FloodData tag:
var floodQuery = entityManager.CreateEntityQuery(typeof(FloodData));

// Using the Entities.ForEach (or query APIs) to operate on flooded entities:
Entities.WithAll<FloodData>().ForEach((Entity e) =>
{
    // Handle flooded entity
}).Schedule();

// Remove the tag when entity is no longer flooded:
entityManager.RemoveComponent<FloodData>(entity);

Additional notes: - Treat this as a pure tag component: presence indicates a flood-related state, absence indicates not flooded / not flood-capable. - Because it implements IQueryTypeParameter, it can be used in query/type-parameter APIs where supported by the DOTS/Entities version in use.