Guest User

DirectionalLightShader.cs

a guest
Feb 20th, 2019
1,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. [ExecuteInEditMode]
  6. public class DirectionalLightShader : MonoBehaviour
  7. {
  8.     [SerializeField]
  9.     Light dirLight;
  10.  
  11.     // Update is called once per frame
  12.     void Update()
  13.     {
  14.         Shader.SetGlobalVector("_LightDirectionVec", -transform.forward);
  15.         Shader.SetGlobalFloat("_LightIntensity", dirLight.intensity);
  16.     }
  17. }
Add Comment
Please, Sign In to add comment