Skip to content

Game.Prefabs.StatisticParameterData

Assembly:
Assembly-CSharp

Namespace:
Game.Prefabs

Type:
struct

Base:
System.ValueType, Unity.Entities.IBufferElementData

Summary:
Represents a single statistic parameter entry intended for use in prefab data and ECS buffers. Contains an integer value and a UnityEngine.Color to represent the parameter's numeric value and its associated display color. Implemented as an IBufferElementData so instances can be stored in a DynamicBuffer on an entity.


Fields

  • public int m_Value
    Holds the numeric value for the statistic parameter (e.g., a count, level, or score). Default is 0 when the struct is default-constructed.

  • public Color m_Color
    Holds the UnityEngine.Color associated with the parameter, typically used for UI or visual representation.

Properties

  • None. This struct exposes public fields directly and does not define properties.

Constructors

  • public StatisticParameterData(int value, Color color)
    Initializes a new StatisticParameterData with the provided integer value and color.

Methods

  • None. This type is a plain data container (no behavior methods).

Usage Example

using Unity.Entities;
using UnityEngine;
using Game.Prefabs;

// Create an instance directly:
var param = new StatisticParameterData(10, Color.red);

// Add to an entity's DynamicBuffer<StatisticParameterData>:
EntityManager em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = /* obtain or create entity that has a StatisticParameterData buffer */;
DynamicBuffer<StatisticParameterData> buffer = em.GetBuffer<StatisticParameterData>(someEntity);
buffer.Add(new StatisticParameterData(42, Color.green));