Game.Prefabs.Climate.ColorAdjustmentsProperties
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs.Climate
Type: class
Base: OverrideablePropertiesComponent
Summary:
Represents a set of overrideable post-processing color adjustment parameters used by weather prefabs. This component wraps HD Render Pipeline's ColorAdjustments volume parameters (post exposure, contrast, color filter, hue shift, saturation) so they can be serialized/configured on Weather/Climate prefabs and bound to a Volume at runtime.
Fields
-
public FloatParameter m_PostExposure
Holds the post-exposure parameter (default 0f). Maps to ColorAdjustments.postExposure on the HDRP ColorAdjustments volume component. -
public ClampedFloatParameter m_Contrast
Contrast parameter clamped between -100 and 100 (default 0). Maps to ColorAdjustments.contrast. -
public ColorParameter m_ColorFilter
Color filter parameter (default Color.white). Configured with hdr = true, no alpha, and eye dropper enabled. Maps to ColorAdjustments.colorFilter and is intended for tinting the final image. -
public ClampedFloatParameter m_HueShift
Hue shift parameter clamped between -180 and 180 (default 0). Maps to ColorAdjustments.hueShift. -
public ClampedFloatParameter m_Saturation
Saturation parameter clamped between -100 and 100 (default 0). Maps to ColorAdjustments.saturation.
Properties
- No additional properties are declared on this type.
This component exposes the above parameters as public fields for inspector editing and serialization.
Constructors
public ColorAdjustmentsProperties()
No custom constructor is defined in source — the default parameterless constructor is used. Field instances are initialized inline as shown in the class source (e.g., new FloatParameter(0f), new ClampedFloatParameter(...), etc.).
Methods
protected override void OnBindVolumeProperties(Volume volume)
Binds this component's fields to an actual HDRP ColorAdjustments volume component on the provided Volume. Implementation obtains (or creates) a ColorAdjustments component via VolumeHelper.GetOrCreateVolumeComponent and assigns the component's parameters to the corresponding fields so they reflect and control the Volume's settings at runtime.
Key behavior: - Ensures a ColorAdjustments component exists on the supplied Volume. - Copies volume parameters into this component's fields (postExposure, contrast, colorFilter, hueShift, saturation). - This binding allows overriding and driving volume settings from weather prefabs or other climate systems.
Usage Example
protected override void OnBindVolumeProperties(Volume volume)
{
ColorAdjustments component = null;
VolumeHelper.GetOrCreateVolumeComponent(volume, ref component);
m_PostExposure = component.postExposure;
m_Contrast = component.contrast;
m_ColorFilter = component.colorFilter;
m_HueShift = component.hueShift;
m_Saturation = component.saturation;
}
Additional notes: - Requires the Unity HDRP ColorAdjustments type (UnityEngine.Rendering.HighDefinition). - Typically used as a child component of WeatherPrefab entries so weather systems can tweak post-processing color adjustments per-weather.