Game.ColorInfomodeBasePrefab
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: public abstract class
Base: InfomodeBasePrefab, IColorInfomode
Summary:
Base prefab for color-based infomodes. Provides a single Color field that is used as the uniform color for the infomode and a default implementation of GetColors that returns that color for all color channels and default values for steps, speed, tiling and fill. The public m_Color field is serialized/inspectable in Unity and exposed read-only via the color property.
Fields
public UnityEngine.Color m_Color
Public color value used by the infomode. This field is typically set in the Unity inspector or by code and is returned by the color property and used by GetColors.
Properties
public UnityEngine.Color color { get; }
Read-only property that returns the value of m_Color. Use this to get the configured color from code without directly accessing the field.
Constructors
public ColorInfomodeBasePrefab()
Default parameterless constructor. As the class is abstract, this constructor is used by derived prefabs; no special initialization is performed by this base class.
Methods
public override void GetColors(out UnityEngine.Color color0, out UnityEngine.Color color1, out UnityEngine.Color color2, out float steps, out float speed, out float tiling, out float fill)
Provides the color configuration for the infomode. This implementation sets:- color0 = m_Color
- color1 = m_Color
- color2 = m_Color
- steps = 1f
- speed = 0f
- tiling = 0f
- fill = 0f
This effectively produces a single-step, static (non-animated) color palette where all channels use the same color.
Usage Example
// Example subclass that sets the color in code.
// In practice m_Color can also be set from the Unity inspector.
public class MyColorInfomodePrefab : Game.Prefabs.ColorInfomodeBasePrefab
{
void Awake()
{
// Set the color used by the infomode
m_Color = UnityEngine.Color.cyan;
}
}
Notes: - The class is abstract; you must derive from it to create an actual prefab usable in the game. - Because m_Color is public, it can be adjusted via the Unity inspector on prefabs derived from this class.