41 lines
911 B
C#
41 lines
911 B
C#
using UnityEngine;
|
|
|
|
[DisallowMultipleComponent]
|
|
[ExecuteInEditMode]
|
|
[RequireComponent(typeof(MeshRenderer))]
|
|
public class AGGlobalSnowTree : MonoBehaviour
|
|
{
|
|
[Range(0f, 1f)]
|
|
[Header("Global Snow for Trees")]
|
|
public float SnowTreeIntensity = 1f;
|
|
|
|
[Range(0f, 1f)]
|
|
public float SnowTreeOffset = 1f;
|
|
|
|
[Range(0f, 1f)]
|
|
public float SnowTreeContrast = 1f;
|
|
|
|
[Range(0f, 1f)]
|
|
public float SnowTreeArrowDirection = 1f;
|
|
|
|
private void Awake()
|
|
{
|
|
if (Application.isPlaying)
|
|
{
|
|
base.gameObject.GetComponent<MeshRenderer>().enabled = false;
|
|
}
|
|
else
|
|
{
|
|
base.gameObject.GetComponent<MeshRenderer>().enabled = true;
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
Shader.SetGlobalFloat("AGT_SnowIntensity", SnowTreeIntensity);
|
|
Shader.SetGlobalFloat("AGT_SnowOffset", SnowTreeOffset);
|
|
Shader.SetGlobalFloat("AGT_SnowContrast", SnowTreeContrast);
|
|
Shader.SetGlobalFloat("AGT_SnowArrow", SnowTreeArrowDirection);
|
|
}
|
|
}
|