cvr-props/Assets/ABI.CCK/Components/CVRGIMaterialUpdater.cs

23 lines
509 B
C#
Raw Normal View History

2023-01-22 16:38:23 +01:00
using UnityEngine;
namespace ABI.CCK.Components
{
[RequireComponent(typeof(Renderer))]
public class CVRGIMaterialUpdater : MonoBehaviour
{
[SerializeField] bool updateEveryFrame;
private Renderer _renderer;
private void Start()
{
_renderer = GetComponent<Renderer>();
}
private void Update()
{
if (_renderer == null || !updateEveryFrame) return;
_renderer.UpdateGIMaterials();
}
}
}