unity 设置天空盒的旋转

设置天空盒不停的旋转

  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. }  


猜你喜欢

转载自blog.csdn.net/qq_33515628/article/details/79883002