Game.Prefabs.Climate.FogProperties
Assembly:
Assembly-CSharp (inferred)
Namespace:
Game.Prefabs.Climate
Type:
class
Base:
OverrideablePropertiesComponent
Summary:
FogProperties is a small helper component intended to be attached to weather-related prefabs (see the [ComponentMenu("Weather/")] attribute). Its purpose is to bind HDRP fog volume properties to the prefab's volume by ensuring a UnityEngine.Rendering.HighDefinition.Fog volume component exists on the provided Volume. This allows the prefab/weather system to override or provide fog settings via the volume system at runtime.
Fields
- (none)
This class declares no private or public instance fields in the source. All behavior is implemented in the override method.
Properties
- (none)
No public properties are declared by this type.
Constructors
public FogProperties()
There is no explicit constructor declared; the default parameterless constructor is used.
Methods
protected override void OnBindVolumeProperties(UnityEngine.Rendering.Volume volume)
This method is called to bind or ensure the necessary volume components exist on the supplied Volume instance. Implementation details:- Retrieves or creates a UnityEngine.Rendering.HighDefinition.Fog component on the given Volume using
VolumeHelper.GetOrCreateVolumeComponent
. - The method's purpose is to make sure the HDRP Fog volume component is present so the weather/prefab system can control fog parameters through the volume.
Signature (from source):
protected override void OnBindVolumeProperties(Volume volume)
{
Fog component = null;
VolumeHelper.GetOrCreateVolumeComponent(volume, ref component);
}
Usage Example
[ComponentMenu("Weather/", new Type[] { typeof(WeatherPrefab) })]
public class FogProperties : OverrideablePropertiesComponent
{
protected override void OnBindVolumeProperties(Volume volume)
{
// Ensure an HDRP Fog volume component exists on the given Volume.
Fog component = null;
VolumeHelper.GetOrCreateVolumeComponent(volume, ref component);
// Now 'component' can be used/modified to set fog parameters for this volume.
}
}
Notes: - The Fog type referenced is UnityEngine.Rendering.HighDefinition.Fog (an HDRP volume component). - VolumeHelper.GetOrCreateVolumeComponent is responsible for adding the component if it's missing; consult its implementation for behavior regarding defaults and initialization.