Color SkyColor { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The SkyColor property of the SceneDirectionalLight class represents the ambient light color outside of all light probes. This property is marked as obsolete, and it is recommended to use the AmbientLight component or World.AmbientLightColor instead for setting ambient light colors.

Usage

To set or get the sky color for a SceneDirectionalLight, you can access the SkyColor property directly. However, since this property is obsolete, consider using the recommended alternatives for future-proofing your code.

Example

// Example of accessing the SkyColor property
SceneDirectionalLight directionalLight = new SceneDirectionalLight();

// This property is obsolete, consider using AmbientLight Component or World.AmbientLightColor
Color currentSkyColor = directionalLight.SkyColor;
directionalLight.SkyColor = new Color(0.5f, 0.5f, 0.5f); // Set to a grey color

// Recommended approach
// Use AmbientLight component or World.AmbientLightColor instead