Game.AreaColorData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
Holds color settings used to render area visuals (fill and edge) and their appearance when selected. Colors are stored as UnityEngine.Color32 (RGBA bytes). Typically used on prefab/entity data to control area visualization in the editor and runtime.
Fields
-
public UnityEngine.Color32 m_FillColor
Default semi-transparent fill color for the area. In GetDefaults() this is (128, 128, 128, 64). -
public UnityEngine.Color32 m_EdgeColor
Color used for the area outline/edge. Default in GetDefaults() is (128, 128, 128, 128). -
public UnityEngine.Color32 m_SelectionFillColor
Fill color applied when the area is selected. Default in GetDefaults() is (128, 128, 128, 128). -
public UnityEngine.Color32 m_SelectionEdgeColor
Edge color applied when the area is selected. Default in GetDefaults() is (128, 128, 128, 255).
Properties
- None. This is a plain value-type component with public fields.
Constructors
public AreaColorData()
Default struct constructor (fields will be zero-initialized unless set). Use GetDefaults() to obtain the commonly used preset values.
Methods
public static AreaColorData GetDefaults() : AreaColorData
Returns a new AreaColorData instance populated with default color values used by the game:- m_FillColor = Color32(128,128,128,64)
- m_EdgeColor = Color32(128,128,128,128)
- m_SelectionFillColor = Color32(128,128,128,128)
- m_SelectionEdgeColor = Color32(128,128,128,255)
Usage Example
using Unity.Entities;
using UnityEngine;
using Game.Prefabs;
// Get default colors and tweak one value
AreaColorData colors = AreaColorData.GetDefaults();
colors.m_FillColor = new Color32(200, 100, 100, 120);
// Add to an entity (example ECS usage)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity e = entityManager.CreateEntity();
entityManager.AddComponentData(e, colors);