soundvision/UnityProject/Assets/Scenes/Examples/Texture/TextureMapper.cs
2019-10-05 16:49:30 +02:00

23 lines
No EOL
571 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace cylvester
{
public class TextureMapper : MonoBehaviour
{
[SerializeField] private Spectrogram spectrogram;
private Renderer renderer_;
private static readonly int baseColorMap_ = Shader.PropertyToID("_BaseColorMap");
void Start()
{
renderer_ = GetComponent<Renderer>();
}
void Update()
{
renderer_.material.SetTexture(baseColorMap_, spectrogram.Texture);
}
}
}