Skip to content

Game.Prefabs.MailAccumulationData

Assembly: Assembly-CSharp (typical game/mod assembly)
Namespace: Game.Prefabs

Type: struct

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

Summary:
Component (ECS value type) used to mark entities that track mail accumulation. Contains a flag indicating whether mail must be collected and a float2 describing the accumulation rate. The exact interpretation of the two components of m_AccumulationRate is determined by the systems that consume this component.


Fields

  • public bool m_RequireCollect
    Indicates whether the entity currently requires collection of accumulated mail. Stored as a simple boolean flag and serialized as part of the component.

  • public float2 m_AccumulationRate
    Accumulation rate stored as a Unity.Mathematics.float2. The two floats represent rate values used by consuming systems (for example different mail channels or directional/axis-based rates). Units and semantics depend on the consumer logic (e.g., per-second rate, per-tick rate).

Properties

  • (none)

Constructors

  • public MailAccumulationData()
    Structs have an implicit parameterless constructor that zero-initializes fields. Default values:
  • m_RequireCollect = false
  • m_AccumulationRate = float2(0f, 0f) You can create instances using object initializer syntax to set desired values.

Methods

  • (none)

Usage Example

using Unity.Entities;
using Unity.Mathematics;
using Game.Prefabs;

// Add component to an existing entity
var mailData = new MailAccumulationData {
    m_RequireCollect = true,
    m_AccumulationRate = new float2(0.5f, 0.0f) // interpretation depends on systems
};
entityManager.AddComponentData(entity, mailData);

// Or update an existing component
entityManager.SetComponentData(entity, new MailAccumulationData {
    m_RequireCollect = false,
    m_AccumulationRate = new float2(1.0f, 0.2f)
});

{{ This component is a plain data container suited for Unity's ECS. Because it implements IComponentData it will be stored in entity chunks and is safe to access in Jobs (subject to proper safety/use of JobHandles). The IQueryTypeParameter implementation allows the type to be used where query-type parameters are supported by your ECS utility code; check your version of the Entities package for exact usage patterns. }}