Advertisement
Guest User

Unity3d skybox rotation script

a guest
Mar 12th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. [ExecuteInEditMode]
  5. public class SkyboxSetup : MonoBehaviour
  6. {
  7. public float RotationDegree;
  8.  
  9. // Update is called once per frame
  10. void Update ()
  11. {
  12. Quaternion rotationDegree = Quaternion.AngleAxis(RotationDegree, Vector3.up);
  13. Matrix4x4 rotationShader = Matrix4x4.TRS(Vector3.zero, rotationDegree, Vector3.one);
  14. RenderSettings.skybox.SetMatrix("_Rotation", rotationShader);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement