Skip to content

Game.Prefabs.RenderingSettingsData

Assembly: Assembly-CSharp (inferred)
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
RenderingSettingsData is an ECS component (IComponentData) that holds a set of Color values used by rendering systems to color prefabs or in-game objects according to different UI/visual states (hovered, override, warning, error, owner). It also implements IQueryTypeParameter so it can be used conveniently in Entities query APIs.


Fields

  • public UnityEngine.Color m_HoveredColor
    A Color used when an object/prefab is hovered by the cursor or selection tool.

  • public UnityEngine.Color m_OverrideColor
    A Color used to indicate an overridden state (for example when a setting is forcibly applied).

  • public UnityEngine.Color m_WarningColor
    A Color used to indicate a warning state (non-critical issues).

  • public UnityEngine.Color m_ErrorColor
    A Color used to indicate an error or invalid state.

  • public UnityEngine.Color m_OwnerColor
    A Color used to indicate ownership or to visually mark an owner-related state.

Properties

  • None (this type exposes public fields; there are no properties).

Constructors

  • public RenderingSettingsData()
    Implicit default constructor generated for the struct. All Color fields default to Color.clear/Color(0,0,0,0) if not explicitly set — initialize fields when creating instances to ensure intended colors.

Methods

  • None (this is a plain data component with no methods).

Usage Example

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

// Example: creating an entity with RenderingSettingsData and setting colors
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = em.CreateArchetype(typeof(RenderingSettingsData));

Entity settingsEntity = em.CreateEntity(archetype);

var renderingSettings = new RenderingSettingsData
{
    m_HoveredColor = Color.yellow,
    m_OverrideColor = new Color(0f, 0.5f, 1f, 1f),
    m_WarningColor = Color.magenta,
    m_ErrorColor = Color.red,
    m_OwnerColor = new Color(0.2f, 0.8f, 0.2f, 1f)
};

em.SetComponentData(settingsEntity, renderingSettings);

{{ Notes: - This struct is intended for use with Unity's ECS (DOTS) systems; systems that perform rendering or UI highlighting can query for this component and apply its colors. - Because fields are public, you can serialize/populate them from authoring components or conversion systems when converting GameObjects to entities. - Keep in mind that Color values should be set with appropriate alpha if transparency is intended. }}