Blend the skybox in unity to change the sky during runtime. You can set Directional Light, Fog, and Skybox Reflection Intensity.
- This shaders and material files are uploaded to the GitHub project.
- In the project, click Create > Preset < Environment Preset to create a new scriptable object.
- Insert 6 image files according to the 6 side.
- Insert the generated presets into Presets.
- You also set Directional Light and RotSpeed.
- Call the script to complete Sky Blend using the preset you set.
public class SampleScript : MonoBehaviour
{
private void Start()
{
StartCoroutine(CoBlendSkies());
}
private IEnumerator CoBlendSkies()
{
while (true)
{
EnviromentManager.Instance.BlendEnviroment("Mid", 5.0f);
yield return new WaitForSeconds(10.0f);
EnviromentManager.Instance.BlendEnviroment("Night", 5.0f);
yield return new WaitForSeconds(10.0f);
EnviromentManager.Instance.BlendEnviroment("Day", 5.0f);
yield return new WaitForSeconds(10.0f);
}
}
}
- You can call with the name of the set file as a key in a single tone, such as EnvironmentManager.Instance.BlendEnvironment("Mid", 5.0f).
The project uploaded on GitHub was uploaded using free Asset. https://assetstore.unity.com/packages/3d/environments/lowpoly-environment-nature-pack-free-187052
https://assetstore.unity.com/packages/2d/textures-materials/sky/skybox-series-free-103633
The shader used in the project referred to the file here. https://gist.github.com/tolotratlt/0cf71ff58a7e7c37a235ec38c6e8b99e