Unity - 设置场景的环境光 RenderSetting.ambientXXX

Lightting Setting

在Unity中菜单栏中:Window->Rendering->Lightting Setting
中可以打开该场景的灯光设置

其中的Enviroment Lighting中,就是设置环境光相关的

Unity Editor下GUI设置有3种:

Source = Skybox, or AmbientMode = Skybox

Unity - 设置场景的环境光 RenderSetting.ambientXXX_第1张图片

Source = Gradient, or AmbientMode = Trilight

Unity - 设置场景的环境光 RenderSetting.ambientXXX_第2张图片

Source = Color, or AmbientMode = Flat

Unity - 设置场景的环境光 RenderSetting.ambientXXX_第3张图片

RenderSetting类相关ambientXXX

Unity - 设置场景的环境光 RenderSetting.ambientXXX_第4张图片

Code

// 所以代码设置的中,假设ambientMode = AmbientMode.Trilight // Trilight == Triple Light 三重光的意思
// 设置为一个傍晚的样子
RenderSetting.ambientMode = AmbientMode.Trilight;
RenderSetting.ambientSkyColor = Color.gray;
RenderSetting.ambientEquatorColor = Color.black;
RenderSetting.ambientGroundColor = Color.black;

你可能感兴趣的:(unity)