OldBlueWater/BlueWater/Assets/Distant Lands/Cozy Weather/Contents/Scripts/Utility/Auxillary/CozySetMoonDirection.cs

25 lines
554 B
C#
Raw Normal View History

2024-01-03 06:34:33 +00:00
using System.Collections;
2023-09-13 05:07:40 +00:00
using System.Collections.Generic;
using UnityEngine;
namespace DistantLands.Cozy
{
[ExecuteAlways]
public class CozySetMoonDirection : MonoBehaviour
{
2024-01-03 06:34:33 +00:00
CozyWeather weatherSphere;
2023-09-13 05:07:40 +00:00
// Update is called once per frame
void Update()
{
2024-01-03 06:34:33 +00:00
if (weatherSphere == null)
weatherSphere = CozyWeather.instance;
weatherSphere.moonDirection = -transform.forward;
2023-09-13 05:07:40 +00:00
Shader.SetGlobalVector("CZY_MoonDirection", -transform.forward);
}
}
}