soundvision/UnityProject/Assets/Scenes/Examples/Texture/TextureMapper.cs

23 lines
571 B
C#
Raw Normal View History

2019-10-05 14:49:30 +00:00
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);
}
}
}