Description
The EndDistance
property of the GradientFogController
struct specifies the distance at which the fog effect ends. This property is used to control the range of the fog effect in a scene, allowing developers to create more realistic and immersive environments by adjusting how far the fog extends from the camera or a specific point in the scene.
Usage
To use the EndDistance
property, you need to have an instance of the GradientFogController
struct. You can then set or get the EndDistance
to control the fog's end distance. This property is a float
value representing the distance in units.
Example
// Example of setting the EndDistance property
GradientFogController fogController = new GradientFogController();
fogController.EndDistance = 1000.0f;
// Example of getting the EndDistance property
float currentEndDistance = fogController.EndDistance;
// Use the EndDistance to adjust fog settings in your scene
if (currentEndDistance < 500.0f)
{
fogController.EndDistance = 750.0f; // Adjust the fog to extend further
}