DMeville

Untitled

Apr 21st, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class ShaderRotation : MonoBehaviour
  6. {
  7. public Material mat;
  8. public GameObject rotationTarget;
  9.  
  10. [ExecuteInEditMode]
  11. void Update()
  12. {
  13. if(mat != null && rotationTarget != null) {
  14. mat.SetFloat("_Rotation", rotationTarget.transform.rotation.eulerAngles.y);
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment