mirror of
https://github.com/imperialsushi/gutterball-3.git
synced 2025-06-15 05:07:42 +00:00
24 lines
570 B
C#
24 lines
570 B
C#
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(WaterBase))]
|
|
[ExecuteInEditMode]
|
|
public class SpecularLighting : MonoBehaviour
|
|
{
|
|
public Transform specularLight;
|
|
private WaterBase waterBase = null;
|
|
|
|
public void Start ()
|
|
{
|
|
waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase));
|
|
}
|
|
|
|
public void Update ()
|
|
{
|
|
if (!waterBase)
|
|
waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase));
|
|
|
|
if (specularLight && waterBase.sharedMaterial)
|
|
waterBase.sharedMaterial.SetVector("_WorldLightDir", specularLight.transform.forward);
|
|
}
|
|
|
|
}
|