soundvision/UnityProject/Assets/Scenes/Examples/Complex Demos/Scripts/LookupTextureVFXBinder.cs

16 lines
507 B
C#
Raw Permalink Normal View History

2020-01-13 15:20:47 +00:00
using UnityEngine;
2020-03-04 20:47:24 +00:00
using UnityEngine.VFX;
2020-01-13 15:20:47 +00:00
public class LookupTextureVFXBinder : MonoBehaviour
{
[SerializeField] private LookupTexture lookupTexture;
[SerializeField] private VisualEffect visualEffect;
public void Update()
{
visualEffect.SetTexture("_LookupTexture", lookupTexture.Texture);
visualEffect.SetInt("_LookupTextureIndex", lookupTexture.Index);
visualEffect.SetInt("_LookupTextureLength", lookupTexture.Index);
}
}