The values
SkyOverride is what you hand to Set. Every property is nullable: a property you leave null is not changed by your mod. SkyState is what you get from Current. It has the same names, and every value is read only.
SkyOverride the values your mod wants to change
WorldSky.Set takes one of these, with only the values you want to change filled in.
public sealed class SkyOverride
{
public bool? FogEnabled { get; set; }
public FogMode? FogMode { get; set; }
public Color? FogColor { get; set; }
public float? FogDensity { get; set; }
public float? FogStart { get; set; }
public float? FogEnd { get; set; }
public Color? AmbientColor { get; set; }
public float? AmbientIntensity { get; set; }
public float? SkyboxExposure { get; set; }
public Color? SunColor { get; set; }
public float? SunIntensity { get; set; }
public float? StarsIntensity { get; set; }
public float? CloudDensity { get; set; }
}
| Property | Type | What it means |
|---|---|---|
FogEnabled | bool? | true turns fog on. false turns it off. |
FogMode | FogMode? | How the fog thickens with distance (Unity’s FogMode). |
FogColor | Color? | The colour of the fog. |
FogDensity | float? | How thick the fog is. 0 or more. |
FogStart | float? | The distance where linear fog starts. |
FogEnd | float? | The distance where linear fog is full. |
AmbientColor | Color? | The colour of the light that fills shadows. |
AmbientIntensity | float? | How strong that light is. 0 or more. |
SkyboxExposure | float? | How bright the sky is. 0 or more. |
SunColor | Color? | The colour of the sunlight. |
SunIntensity | float? | How strong the sunlight is. 0 or more. |
StarsIntensity | float? | How bright the stars are. 0 or more. |
CloudDensity | float? | How thick the clouds are, from 0 to 1. |
SkyState what the sky looks like now
WorldSky.Current gives you one of these, which is the sky as it looks at that moment.
public sealed class SkyState
{
public bool FogEnabled { get; }
public FogMode FogMode { get; }
public Color FogColor { get; }
public float FogDensity { get; }
public float FogStart { get; }
public float FogEnd { get; }
public Color AmbientColor { get; }
public float AmbientIntensity { get; }
public float? SkyboxExposure { get; }
public Color? SunColor { get; }
public float? SunIntensity { get; }
public float? StarsIntensity { get; }
public float? CloudDensity { get; }
}
| Property | Type | What it means |
|---|---|---|
FogEnabled | bool | true when fog is on. |
FogMode | FogMode | The fog type. |
FogColor | Color | The fog colour. |
FogDensity | float | The fog thickness. |
FogStart | float | Where linear fog starts. |
FogEnd | float | Where linear fog is full. |
AmbientColor | Color | The colour of the light that fills shadows. |
AmbientIntensity | float | How strong that light is. |
SkyboxExposure | float? | null when the scene has no sky that carries it. |
SunColor | Color? | null when the scene has no sun light. |
SunIntensity | float? | null when the scene has no sun light. |
StarsIntensity | float? | null when the scene has no sky that carries it. |
CloudDensity | float? | null when the scene has no sky that carries it. |
Things to know
- The fog and ambient values in
SkyStatealways have a value. The others arenullwhen the scene does not contain the object that holds them. A scene can use a different mix of sky systems than another, so a value you can read in one scene may benullin the next. (the game’s scenes useSunDirection, the Azure sky controllers, or both. A property whose object is missing is skipped, andCurrentreports it asnull.) AmbientColorsets every kind of ambient light to the same colour. (flat, sky, equator and ground ambient colours all get the value.)SkyboxExposurechanges the sky’s brightness whichever way the scene draws its sky. It sets the_Exposureproperty of the current skybox material when it has one, and the exposure of the Azure sky controller when one is in the scene.SunColorandSunIntensitychange every sun light the sky systems drive. In the game the sun and the moon share one light, so this changes the moonlight too.
Limits
- The Azure fog is not the same as the fog you change here. The game draws its own fog as a screen effect from the sky’s shader values, and these properties change Unity’s built-in fog only. So
FogEnabledand the other fog values may look different from the Azure fog you see. (Azure fog is driven byglobalFogDistanceand other shader values, not byRenderSettings.fog.)