修改天空盒5261颜色的例子(C#):
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Color colorStart = Color.blue;
public Color colorEnd = Color.green;
public float duration = 1.0F;
void Update() {
float lerp = Mathf.PingPong(Time.time, duration) / duration;
RenderSettings.skybox.SetColor("_Tint", Color.Lerp(colorStart, colorEnd, lerp));
}
}
修改天空盒材质4102的例子(C#):
// 加载所有 skybox 纹理1653
Texture2D sbFront = Resources.Load("Texture/Skybox/skybox_Front") as Texture2D;
Texture2D sbBack = Resources.Load("Texture/Skybox/skybox_Back") as Texture2D;
...
// 创建新的 SkyBox 材质
Material mySkyBoxMat = new Material(Resources.Load("Shaders/myOwnSkyboxShader") as Shader);
// 将所有纹理添加到材质中