Skip to content

Game.Prefabs.BrandData

Assembly:
Game

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter, IEmptySerializable

Summary:
BrandData is a small ECS component used by prefab entities to carry a ColorSet that defines brand-related coloring information (used by rendering and UI). It implements Unity.Entities.IComponentData so it can be attached to entities, IQueryTypeParameter to be used conveniently in entity queries, and IEmptySerializable to control how the game's serialization system treats this component (see notes below).


Fields

  • public Game.Rendering.ColorSet m_ColorSet
    Holds the ColorSet used for the prefab's brand colors. ColorSet is defined in Game.Rendering and typically contains the color variants and palettes used by rendering/UI systems for branded prefabs.

Properties

  • This type does not define any properties.

Constructors

  • public BrandData()
    No explicit constructors are defined in source; the struct uses the default value constructor. Create and set m_ColorSet via object/initializer syntax when needed.

Methods

  • This type does not declare any methods.

Notes on implemented interfaces: - IComponentData — marks this struct as an ECS component that can be added to entities (EntityManager.AddComponentData / SetComponentData). - IQueryTypeParameter — allows BrandData to be used as a query parameter when building entity queries with Unity.Entities APIs. - IEmptySerializable — indicates special handling for the game's serializer (Colossal.Serialization). In practice this means the component is treated differently by the built-in game serializer; if persistence of the color data is required across save/load for custom usage, mod authors should verify serialization behavior and handle persistence explicitly if necessary.

Usage Example

using Game.Prefabs;
using Game.Rendering;
using Unity.Entities;

// Example: attach a BrandData component to an entity with an existing ColorSet
void AttachBrandToEntity(EntityManager entityManager, Entity entity, ColorSet colorSet)
{
    var brand = new BrandData { m_ColorSet = colorSet };
    if (!entityManager.HasComponent<BrandData>(entity))
    {
        entityManager.AddComponentData(entity, brand);
    }
    else
    {
        entityManager.SetComponentData(entity, brand);
    }
}