Files
Fishing2/Assets/MicroVerse-Presets/Scripts/MicroVerse Presets 1/Runtime/Time of Day/TimeOfDay.cs
2025-06-09 23:23:13 +08:00

24 lines
615 B
C#

#if USING_HDRP
using UnityEngine;
namespace Rowlan.MicroVerse.Presets
{
/// <summary>
/// Wrapper for LightAnchor which binds it to the directional light in the scene
/// </summary>
[ExecuteInEditMode]
public class TimeOfDay : LightAnchor
{
void Update()
{
// currently an editor only feature
if (Application.isPlaying)
return;
// map the current transform to the light
Light directionalLight = RenderSettings.sun;
directionalLight.transform.rotation = transform.rotation;
}
}
}
#endif