Skip to content

Game.Prefabs.IColorInfomode

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: Interface

Base:

Summary:
Interface that exposes a read-only UnityEngine.Color property named color. Typically implemented by prefabs or components that provide a color for an "info mode" (visual overlays, legend colors, UI indicators, etc.). The property returns a UnityEngine.Color value and is intended for read-only consumption by rendering or UI code.


Fields

  • (none)
    This interface declares no backing fields. Implementations may store color data in serialized fields or computed properties.

Properties

  • public UnityEngine.Color color { get; }
    Read-only color value provided by the implementer. The returned value is a UnityEngine.Color (RGBA floats). Implementations should decide whether the color is stored (e.g., serialized private field) or computed on demand.

Constructors

  • (none)
    Interfaces do not define constructors. Concrete types implementing this interface provide their own constructors or use Unity lifecycle initialization.

Methods

  • (none)
    This interface declares no methods beyond the property getter.

Usage Example

using UnityEngine;
using Game.Prefabs;

public class MyColorInfoMode : MonoBehaviour, IColorInfomode
{
    [SerializeField] private Color m_Color = Color.white;

    // IColorInfomode implementation
    public Color color => m_Color;
}

// Accessing the color from another component
public class ColorConsumer : MonoBehaviour
{
    void Start()
    {
        var info = GetComponent<IColorInfomode>();
        if (info != null)
        {
            Color c = info.color;
            // Use c for UI, overlays, etc.
        }
    }
}

{{ Notes: Use UnityEngine.Color (float components). If you need compact color storage, consider Color32 and convert to/from Color when implementing the interface. }}