Game.Prefabs.OverlayConfigurationPrefab
Assembly:
Assembly-CSharp.dll
Namespace:
Game.Prefabs
Type:
class
Base:
PrefabBase
Summary:
Prefab class used to store configuration assets for overlay rendering in the game. Exposes references to materials and font information that the overlay systems use at runtime, and ensures the corresponding ECS component (OverlayConfigurationData) is registered for entities created from this prefab. The ComponentMenu attribute places this prefab under "Settings/" in the Unity inspector.
Fields
-
public UnityEngine.Material m_CurveMaterial
Reference to a Unity Material used for drawing curves in overlays (e.g., lines, guides). Assign in the prefab to control the visual style for curve rendering. -
public UnityEngine.Material m_ObjectBrushMaterial
Reference to a Unity Material used for object brush overlays (e.g., placement preview, area brushes). Assign in the prefab to control brush/material visuals. -
public FontInfo[] m_FontInfos
Array of FontInfo entries containing font-related configuration used by overlay text rendering. Each FontInfo typically contains font asset and related metrics/settings required by overlay UIs.
Properties
- None. This prefab only exposes public fields and overrides behavior via methods.
Constructors
public OverlayConfigurationPrefab()
No explicit constructor is declared in the source; the default parameterless constructor provided by C# is used. Initialization of fields should be done in the Unity editor by configuring the prefab asset.
Methods
public override void GetPrefabComponents(HashSet<ComponentType> components)
Overrides PrefabBase.GetPrefabComponents to collect the ECS component types that entities created from this prefab should have. Implementation details:- Calls base.GetPrefabComponents(components) to include components provided by the base.
- Adds
ComponentType.ReadWrite<OverlayConfigurationData>()
to the provided set so that an OverlayConfigurationData component will be present on entities derived from this prefab. This ensures the overlay configuration data is available to systems that expect it in the ECS world.
Usage Example
// OverlayConfigurationPrefab registers OverlayConfigurationData with the prefab's entity components.
// Typical implementation (as in source):
public override void GetPrefabComponents(HashSet<ComponentType> components)
{
base.GetPrefabComponents(components);
components.Add(ComponentType.ReadWrite<OverlayConfigurationData>());
}
// Example: Create a prefab asset in Unity, assign m_CurveMaterial, m_ObjectBrushMaterial and m_FontInfos
// then, when the prefab is converted to an entity, the OverlayConfigurationData component will be added
// and overlay rendering systems can read the configured materials and fonts from that component.