Skip to content

Game.Prefabs.BrandObjectData

Assembly: Game
Namespace: Game.Prefabs

Type: struct

Base: Implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
BrandObjectData is an empty "tag" component (marker component) used to identify entities that represent a brand object/prefab in the game's ECS. It is attributed with StructLayout(LayoutKind.Sequential, Size = 1) so the struct occupies 1 byte; this ensures a non-zero size for the component while still carrying no data. Use this component to mark, filter, or query entities without storing additional state.


Fields

  • (none)
    This struct declares no instance fields. It is an empty marker component; the StructLayout attribute (Size = 1) gives it a 1-byte footprint.

Properties

  • (none)
    There are no properties defined on this type.

Constructors

  • public BrandObjectData()
    As a value type, BrandObjectData has the implicit default constructor. No explicit constructors are defined. Use the default instance when adding the component (e.g., new BrandObjectData()).

Methods

  • (none)
    No methods are implemented. The type implements only marker interfaces (IComponentData and IQueryTypeParameter) and does not provide behavior.

Usage Example

// Mark an entity as a BrandObject
var brandTag = new BrandObjectData();
entityManager.AddComponentData(entity, brandTag);

// Query for entities that are brand objects
Entities
    .WithAll<BrandObjectData>()
    .ForEach((Entity e) =>
    {
        // handle brand object entity
    }).ScheduleParallel();

Additional notes: - Because this is a tag component, prefer using it when you only need to identify or filter entities rather than store data. - The explicit size ensures compatibility with systems or tooling that may require non-zero-sized components.