Game.Prefabs.RandomColorData
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
A lightweight ECS component that stores two Bounds3 ranges used by systems that apply randomized color/variation or spatial-based variation to prefabs. Each Bounds3 represents a min/max 3D range (typically using float3) that can be used to drive randomness or parameterization based on angle and position. This struct is a plain value-type component intended to be attached to entities.
Fields
-
public Colossal.Mathematics.Bounds3 m_AngleRange
Range describing angle-related values. Represented as a Bounds3 (min and max float3). Systems can use this to sample or clamp angle-based parameters (for example hue/rotation offsets or other per-instance angular variation). -
public Colossal.Mathematics.Bounds3 m_PositionRange
Range describing position-related values. Represented as a Bounds3 (min and max float3). Systems can use this to sample or clamp position-based parameters (for example spatial offsets that affect color or other per-instance variation).
Properties
- This type has no properties.
Constructors
public RandomColorData()
Implicit default constructor for the value type. Fields default to the default Bounds3 (typically zeroed min/max). Initialize explicitly when adding the component to an entity.
Methods
- This type defines no methods beyond the default value-type members.
Usage Example
using Colossal.Mathematics;
using Unity.Entities;
using Unity.Mathematics;
// Create and add the component to an entity with explicit ranges:
var randomColor = new Game.Prefabs.RandomColorData
{
m_AngleRange = new Bounds3(new float3(-10f, -10f, -10f), new float3(10f, 10f, 10f)),
m_PositionRange = new Bounds3(new float3(-1f, 0f, -1f), new float3(1f, 2f, 1f))
};
entityManager.AddComponentData(someEntity, randomColor);
// A system can read this component and sample values within the provided Bounds3 to drive per-instance variation.