33 lines
537 B
C#
33 lines
537 B
C#
using UnityEngine;
|
|
|
|
public class EnviroReflections : MonoBehaviour
|
|
{
|
|
public ReflectionProbe probe;
|
|
|
|
public float ReflectionUpdateInGameHours = 1f;
|
|
|
|
private float lastUpdate;
|
|
|
|
private void Start()
|
|
{
|
|
if (probe == null)
|
|
{
|
|
probe = GetComponent<ReflectionProbe>();
|
|
}
|
|
}
|
|
|
|
private void UpdateProbe()
|
|
{
|
|
probe.RenderProbe();
|
|
lastUpdate = EnviroSky.instance.currentTimeInHours;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (EnviroSky.instance.currentTimeInHours > lastUpdate + ReflectionUpdateInGameHours)
|
|
{
|
|
UpdateProbe();
|
|
}
|
|
}
|
|
}
|