unity3d 如何让天空旋转

转自http://blog.csdn.net/jwxkk/article/details/70186068

首先,给镜头增加skybox,然后给镜头添加如下代码即可

 1     public class SkyboxCamera : MonoBehaviour {  
 2         public float rot = 0;  
 3         public Skybox sky;  
 4         // Use this for initialization  
 5         void Start () {  
 6             sky = GetComponent<Skybox>();  
 7         }  
 8           
 9         // Update is called once per frame  
10         void Update () {  
11             rot += 0.7f * Time.deltaTime;  
12             rot %= 360;  
13             sky.material.SetFloat("_Rotation", rot);  
14         }  
15     }  
原文地址:https://www.cnblogs.com/lpcoder/p/6872527.html