You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
712 B
C#

3 years ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class TOD_Values : MonoBehaviour
{
public bool Active;
public Color ambientLight;
public Vector3 SunDirection = Vector3.zero;
Light Sun;
public float SunIntensity = 1;
public Color SunColor = Color.white;
void OnEnable()
{
Sun = gameObject.GetComponent<FogVolume>().Sun;
}
void Update()
{
if (this.Active && Sun)
{
Sun.transform.eulerAngles=SunDirection;
Sun.color = SunColor;
Sun.intensity = SunIntensity;
RenderSettings.ambientLight = this.ambientLight;
}
}
}